You are here

public function CerHandler::insert in Corresponding Entity References 7.2

Implements CerHandlerInterface::insert().

Overrides CerHandlerInterface::insert

1 call to CerHandler::insert()
CerHandler::update in ./handler.inc
Implements CerHandlerInterface::update().

File

./handler.inc, line 172
Contains base code for CER handlers, which are objects responsible for creating, updating and deleting corresponding references between entities.

Class

CerHandler
@class Generic CER handler with rudimentary language handling.

Code

public function insert($ids = NULL) {
  if (empty($ids)) {
    $entities = $this
      ->getReferencedEntities();
  }
  else {
    $entities = entity_load($this->remote['entity_type'], $ids);
  }
  foreach ($entities as $referenced_entity) {
    $this
      ->reference($referenced_entity);
    _cer_update($this->remote['entity_type'], $referenced_entity);
  }
}