I want to create a custom created_at
annotation in ZF2
. I found a (German) tutorial how to build such an annotation in Symfony2.
Everything seems easy to copy except the registering of the prePersist
listener.
The code in Symfony is:
services:
created_at_listener:
class: Scandio\Annotations\Driver\CreatedAtDriver
tags:
- {name: doctrine.event_listener, event: prePersist}
arguments: [@annotation_reader]
Any suggestions how to achieve this in Zend?
Thanks!
Easier solution:
without costly event functionality.
Thanks to Ocramius I found a different solution for creating a
PrePersist
created at timestamp: