Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function save(EntityInterface $entity)
 {
     $transaction = $this->database->startTransaction();
     try {
         $return = parent::save($entity);
         // Ignore replica server temporarily.
         db_ignore_replica();
         return $return;
     } catch (\Exception $e) {
         $transaction->rollback();
         watchdog_exception($this->entityTypeId, $e);
         throw new EntityStorageException($e->getMessage(), $e->getCode(), $e);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function save(EntityInterface $entity)
 {
     $transaction = $this->database->startTransaction();
     try {
         // Sync the changes made in the fields array to the internal values array.
         $entity->updateOriginalValues();
         $return = parent::save($entity);
         // Ignore replica server temporarily.
         db_ignore_replica();
         return $return;
     } catch (\Exception $e) {
         $transaction->rollback();
         watchdog_exception($this->entityTypeId, $e);
         throw new EntityStorageException($e->getMessage(), $e->getCode(), $e);
     }
 }