Created
January 31, 2013 17:48
-
-
Save eminetto/4684756 to your computer and use it in GitHub Desktop.
Exemplo de evento do TableGateway do ZF2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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