public function CerFieldChainHandler::__construct in Corresponding Entity References 7.3
File
- includes/CerFieldChainHandler.inc, line 34
- Contains the CerFieldChainHandler object.
Class
- CerFieldChainHandler
- @class
Wraps around every CerFieldHandler object in a chain. In any given chain, there
could be many entities that need to be processed -- think about multi-value field
collections embedded within other multi-value field collections, and you…
Code
public function __construct(CerFieldChain $chain, EntityDrupalWrapper $entity) {
$this->chain = $chain;
$this->entity = $entity;
$chain
->__wakeup();
$chain
->seek($entity->cer->depth
->value());
$field = $chain
->current();
if ($field
->child()) {
$this->handlers = new RecursiveIteratorIterator(new CerEndPointIterator($field, $entity));
}
else {
$this->handlers = array(
$field
->getHandler($entity),
);
}
}