You are here

public function CerFieldHandler::__construct in Corresponding Entity References 7.3

1 call to CerFieldHandler::__construct()
CerFieldHandler::write in includes/CerFieldHandler.inc
Saves changes to the entity and resets the iterator.

File

includes/CerFieldHandler.inc, line 41
Contains CerFieldHandler.

Class

CerFieldHandler
@class Handles low-level operations for a single field on a single entity. Exposes methods to add, delete and check for references. This will also iterate over the references, returning each one as an EntityDrupalWrapper object.

Code

public function __construct(CerField $field, EntityDrupalWrapper $entity) {
  $this->field = $field;
  $this->entity = $entity;
  $this->value = $entity->{$field->name};
  $this->isMultiValue = $this->value instanceof EntityListWrapper;
  $this
    ->rewind();
}