Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created January 31, 2013 17:48
Show Gist options
  • Save eminetto/4684756 to your computer and use it in GitHub Desktop.
Save eminetto/4684756 to your computer and use it in GitHub Desktop.
Exemplo de evento do TableGateway do ZF2
public function saveAction()
{
$tableGateway = $this->getTable('Application\Model\Post');
$em = new EventManager;
$em->attach('postInsert', array($this, 'postInsert'));
$eventFeature = new EventFeature($em);
$tableGateway->getFeatureSet()->addFeature($eventFeature);
}
/**
* Será executado no postInsert do TableGateway
* @return void
*/
public function postInsert()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment