Nextras\Orm\Entity\IEntity::isModified PHP Méthode

isModified() public méthode

Returns true if the entity is modiefied or the column $name is modified.
public isModified ( string $name = null ) : boolean
$name string
Résultat boolean
    public function isModified($name = null);

Usage Example

Exemple #1
0
 /** @inheritdoc */
 public function doPersist(IEntity $entity)
 {
     if (!$entity->isModified()) {
         return;
     }
     $isPersisted = $entity->isPersisted();
     $this->doFireEvent($entity, $isPersisted ? 'onBeforeUpdate' : 'onBeforeInsert');
     $isPersisted && $this->identityMap->remove($entity->getPersistedId());
     // id can change in composite key
     $id = $this->mapper->persist($entity);
     $entity->fireEvent('onPersist', [$id]);
     $this->identityMap->add($entity);
     $this->entitiesToFlush[0][] = $entity;
     $this->doFireEvent($entity, $isPersisted ? 'onAfterUpdate' : 'onAfterInsert');
     $this->doFireEvent($entity, 'onAfterPersist');
 }
All Usage Examples Of Nextras\Orm\Entity\IEntity::isModified