PHP Class Sulu\Component\Persistence\EventSubscriber\ORM\TimestampableSubscriber

Inheritance: implements Doctrine\Common\EventSubscriber
Show file Open project: sulu/sulu

Public Methods

Method Description
getSubscribedEvents ( )
loadClassMetadata ( Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs $event ) Load the class data, mapping the created and changed fields to datetime fields.
prePersist ( Doctrine\Common\Persistence\Event\LifecycleEventArgs $event ) Set the timestamps before creation.
preUpdate ( Doctrine\Common\Persistence\Event\LifecycleEventArgs $event ) Set the timestamps before update.

Private Methods

Method Description
handleTimestamp ( Doctrine\Common\Persistence\Event\LifecycleEventArgs $event ) Set the timestamps. If created is NULL then set it. Always set the changed field.

Method Details

getSubscribedEvents() public method

public getSubscribedEvents ( )

loadClassMetadata() public method

Load the class data, mapping the created and changed fields to datetime fields.
public loadClassMetadata ( Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs $event )
$event Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs

prePersist() public method

Set the timestamps before creation.
public prePersist ( Doctrine\Common\Persistence\Event\LifecycleEventArgs $event )
$event Doctrine\Common\Persistence\Event\LifecycleEventArgs

preUpdate() public method

Set the timestamps before update.
public preUpdate ( Doctrine\Common\Persistence\Event\LifecycleEventArgs $event )
$event Doctrine\Common\Persistence\Event\LifecycleEventArgs