https://github.com/lstrojny/procrastinatorbundle
Symfony2 integration for Procrastinator
https://github.com/lstrojny/procrastinatorbundle
Last synced: about 1 month ago
JSON representation
Symfony2 integration for Procrastinator
- Host: GitHub
- URL: https://github.com/lstrojny/procrastinatorbundle
- Owner: lstrojny
- Created: 2012-02-05T20:29:26.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2017-02-26T22:55:08.000Z (over 8 years ago)
- Last Synced: 2025-03-31T02:21:58.812Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ProcrastinatorBundle for Symfony2: do stuff later [](http://travis-ci.org/lstrojny/ProcrastinatorBundle) [](https://www.versioneye.com/user/projects/523ed7f8632bac1b1400bff0) [](http://isitmaintained.com/project/lstrojny/procrastinatorbundle "Average time to resolve an issue") [](http://isitmaintained.com/project/lstrojny/procrastinatorbundle "Percentage of issues still open")
Symfony2 integration for [Procrastinator](https://github.com/lstrojny/Procrastinator)
### Example usage in controller to execute event only if the postFlush event in Doctrine occured
```php
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();
}
}
```