Nextras\Orm\Entity\IEntity::fireEvent PHP Method

fireEvent() public method

Fires event.
public fireEvent ( string $method, array $args = [] )
$method string
$args array
    public function fireEvent($method, $args = []);

Usage Example

Example #1
0
 protected function processMySQLAutoupdate(IEntity $entity, array $args)
 {
     $this->connection->queryArgs($args);
     $primary = [];
     $id = (array) ($entity->isPersisted() ? $entity->getPersistedId() : $this->connection->getLastInsertedId());
     foreach ($this->getStorageReflection()->getStoragePrimaryKey() as $key) {
         $primary[$key] = array_shift($id);
     }
     $row = $this->connection->query('SELECT %ex FROM %table WHERE %and', $this->getAutoupdateReselectExpression(), $this->getTableName(), $primary)->fetch();
     $data = $this->getStorageReflection()->convertStorageToEntity($row->toArray());
     $entity->fireEvent('onRefresh', [$data]);
 }
All Usage Examples Of Nextras\Orm\Entity\IEntity::fireEvent