[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/zendframework/zend-stdlib/src/Hydrator/Strategy/ -> ClosureStrategy.php (summary)

Zend Framework (http://framework.zend.com/)

Copyright: Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
License: http://framework.zend.com/license/new-bsd New BSD License
File Size: 102 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ClosureStrategy:: (3 methods):
  __construct()
  extract()
  hydrate()


Class: ClosureStrategy  - X-Ref

__construct($extractFunc = null, $hydrateFunc = null)   X-Ref
You can describe how your values will extract and hydrate, like this:
$hydrator->addStrategy('category', new ClosureStrategy(
function (Category $value) {
return (int) $value->id;
},
function ($value) {
return new Category((int) $value);
}
));

param: callable $extractFunc - anonymous function, that extract values
param: callable $hydrateFunc - anonymous function, that hydrate values

extract($value, $object = null)   X-Ref
Converts the given value so that it can be extracted by the hydrator.

param: mixed $value  The original value.
param: array $object The object is optionally provided as context.
return: mixed Returns the value that should be extracted.

hydrate($value, $data = null)   X-Ref
Converts the given value so that it can be hydrated by the hydrator.

param: mixed $value The original value.
param: array $data  The whole data is optionally provided as context.
return: mixed Returns the value that should be hydrated.



Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1