mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-23 06:50:15 +02:00
26 lines
429 B
PHP
26 lines
429 B
PHP
<?php
|
|
|
|
/*
|
|
* DesignPatternPHP
|
|
*/
|
|
|
|
namespace DesignPatterns\AbstractFactory;
|
|
|
|
/**
|
|
* JsonFactory is a factory for creating a family of JSON component
|
|
* (example for ajax)
|
|
*/
|
|
class JsonFactory extends AbstractFactory
|
|
{
|
|
|
|
public function createPicture($path, $name = '')
|
|
{
|
|
return new Json\Picture($path, $name);
|
|
}
|
|
|
|
public function createText($content)
|
|
{
|
|
return new Json\Text($content);
|
|
}
|
|
|
|
} |