Transform objects after loading.
More...
|
static | start () |
| Load all transformers.
|
|
static | startProd (?string $op='transform') |
| Start the manager for production.
|
|
static | registerClass (string $transformer, string $classname) |
| Register a new transformer class.
|
|
static | registerClassAndSave (string $transformer, string $classname) |
| Register and save in cache a new Transformer.
|
|
static | registerClasses (array $transformersAndClasses) |
| Register an associative array of transformers based on ['name'=>'transformerClass'].
|
|
static | registerClassesAndSave (array $transformersAndClasses) |
| Register and save an associative array of transformers based on ['name'=>'transformerClass'].
|
|
static | getTransformerClass (string $transformer) |
| Return the class from a transformer name.
|
|
static | transform (object $instance, string $member, ?string $transform='transform') |
| Transform a member of an instance.
|
|
static | applyTransformer (object $instance, string $member, $value, ?string $transform='transform') |
| Apply a transformer using a member transformer(s) on a value.
|
|
static | transformInstance (object $instance, $transform='transform') |
| Transform all the members of a model instance.
|
|
static | transformInstances (array $instances, $transform='transform') |
| Transform all the members of a model instances.
|
|
static | store () |
| Store the loaded transformers in cache.
|
|
|
const | TRANSFORMER_TYPES = ['reverse' => TransformerInterface::class, 'transform' => TransformerInterface::class, 'toView' => TransformerViewInterface::class, 'toForm' => TransformerFormInterface::class] |
|
|
static | $transformers = ['md5' => Md5::class, 'datetime' => DateTime::class, 'upper' => UpperCase::class, 'firstUpper' => FirstUpperCase::class, 'lower' => LowerCase::class, 'password' => Password::class, 'hpassword' => HidePassword::class, 'boolean' => Boolean::class] |
|
static | $key = 'contents/transformers' |
|
Transform objects after loading.
Ubiquity\contents\transformation\transformers$TransformersManager This class is part of Ubiquity
- Author
- jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
- Version
- 1.0.5
Definition at line 27 of file TransformersManager.php.
◆ applyTransformer()
static applyTransformer |
( |
object |
$instance, |
|
|
string |
$member, |
|
|
|
$value, |
|
|
?string |
$transform = 'transform' |
|
) |
| |
|
static |
Apply a transformer using a member transformer(s) on a value.
- Parameters
-
object | $instance | |
string | $member | |
mixed | $value | |
| ?string | $transform |
- Returns
- mixed
Definition at line 147 of file TransformersManager.php.
◆ getTransformerClass()
static getTransformerClass |
( |
string |
$transformer | ) |
|
|
static |
◆ registerClass()
static registerClass |
( |
string |
$transformer, |
|
|
string |
$classname |
|
) |
| |
|
static |
Register a new transformer class.
Do not used at runtime !
- Parameters
-
string | $transformer | |
string | $classname | |
Definition at line 66 of file TransformersManager.php.
◆ registerClassAndSave()
static registerClassAndSave |
( |
string |
$transformer, |
|
|
string |
$classname |
|
) |
| |
|
static |
Register and save in cache a new Transformer.
Do not used at runtime !
- Parameters
-
string | $transformer | |
string | $classname | |
Definition at line 77 of file TransformersManager.php.
◆ registerClasses()
static registerClasses |
( |
array |
$transformersAndClasses | ) |
|
|
static |
Register an associative array of transformers based on ['name'=>'transformerClass'].
Do not used at runtime !
- Parameters
-
array | $transformersAndClasses | |
Definition at line 89 of file TransformersManager.php.
◆ registerClassesAndSave()
static registerClassesAndSave |
( |
array |
$transformersAndClasses | ) |
|
|
static |
Register and save an associative array of transformers based on ['name'=>'transformerClass'].
Do not used at runtime !
- Parameters
-
array | $transformersAndClasses | |
Definition at line 101 of file TransformersManager.php.
◆ start()
◆ startProd()
static startProd |
( |
?string |
$op = 'transform' | ) |
|
|
static |
◆ store()
◆ transform()
static transform |
( |
object |
$instance, |
|
|
string |
$member, |
|
|
?string |
$transform = 'transform' |
|
) |
| |
|
static |
Transform a member of an instance.
- Parameters
-
object | $instance | |
string | $member | |
| ?string | $transform |
- Returns
- ?mixed
Definition at line 130 of file TransformersManager.php.
◆ transformInstance()
static transformInstance |
( |
object |
$instance, |
|
|
|
$transform = 'transform' |
|
) |
| |
|
static |
Transform all the members of a model instance.
- Parameters
-
object | $instance | |
string | $transform | |
Definition at line 163 of file TransformersManager.php.
◆ transformInstances()
static transformInstances |
( |
array |
$instances, |
|
|
|
$transform = 'transform' |
|
) |
| |
|
static |
Transform all the members of a model instances.
- Parameters
-
array | $instances | |
string | $transform | |
Definition at line 186 of file TransformersManager.php.
◆ $key
$key = 'contents/transformers' |
|
staticprivate |
◆ $transformers
$transformers = ['md5' => Md5::class, 'datetime' => DateTime::class, 'upper' => UpperCase::class, 'firstUpper' => FirstUpperCase::class, 'lower' => LowerCase::class, 'password' => Password::class, 'hpassword' => HidePassword::class, 'boolean' => Boolean::class] |
|
staticprivate |
◆ TRANSFORMER_TYPES
const TRANSFORMER_TYPES = ['reverse' => TransformerInterface::class, 'transform' => TransformerInterface::class, 'toView' => TransformerViewInterface::class, 'toForm' => TransformerFormInterface::class] |
The documentation for this class was generated from the following file:
- C:/Users/myadd/Documents/GitHub/ubiquity-doc-api/vendor/phpmv/ubiquity/src/Ubiquity/contents/transformation/TransformersManager.php