lstrojny/procrastinator-bundle
最新稳定版本:2.4.1
Composer 安装命令:
composer require lstrojny/procrastinator-bundle
包简介
Symfony2 integration for Procrastinator (lstrojny/procrastinator)
README 文档
README
Symfony2 integration for Procrastinator
Example usage in controller to execute event only if the postFlush event in Doctrine occured
<?php use Procrastinator\Deferred\DoctrineEventConditionalDeferred as Deferred; use Doctrine\ORM\Events as OrmEvents; class MyController ... { public function sendMailAction() { $entry = new Entity(); $entry->setText('hello world'); $message = Message::newInstance() ->setSubject('hello') ->setBody('new entry'); $mailer = $this->get('mailer'); $procrastinator->register( $procrastinator ->newDeferred() ->ifDoctrineEvent(OrmEvents::postFlush) ->name('sendMail') ->call(function() use ($mailer, $message) { $mailer->send($message); }) ->build() ); $em = $this->get('doctrine.orm.default_entity_manager'); $em->persist($entry); $em->flush(); } }
统计信息
- 总下载量: 113
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-11-06