You are here

public function ColorizedGmapEntityController::save in Colorized google maps block 7

Overridden to care exportables that are overridden.

Overrides EntityAPIControllerExportable::save

File

./colorized_gmap.info.inc, line 150
Entitie's classes, controllers, etc.

Class

ColorizedGmapEntityController
colorized_gmap entity controller.

Code

public function save($entity, DatabaseTransaction $transaction = NULL) {

  // Preload $entity->original by name key if necessary.
  if (!empty($entity->{$this->nameKey}) && empty($entity->{$this->idKey}) && !isset($entity->original)) {
    $entity->original = entity_load_unchanged($this->entityType, $entity->{$this->nameKey});
  }

  // Update the status for entities getting overridden.
  if (entity_has_status($this->entityType, $entity, ENTITY_IN_CODE) && empty($entity->is_rebuild)) {
    $entity->{$this->statusKey} |= ENTITY_CUSTOM;
  }
  $entity->changed = REQUEST_TIME;
  return parent::save($entity, $transaction);
}