src/PN/Bundle/UserBundle/Entity/User.php
/**
     * Now we tell doctrine that before we persist or update we call the updatedTimestamps() function.
     *
     * @ORM\PrePersist
     * @ORM\PreUpdate
     */
Now we tell doctrine that before we persist or update we call the updatedTimestamps() function.
Now we tell doctrine that before we persist or update we call the updatedTimestamps () function .
public function updatedTimestamps() {
        $this->setModified(new \DateTime(date('Y-m-d H:i:s')));
        if ($this->getCreated() == null) {
            $this->setCreated(new \DateTime(date('Y-m-d H:i:s')));
        }
    }
public function updatedTimestamps ( ) { $ this -> setModified ( new \ DateTime ( date ( 'Y-m-d H:i:s' ) ) ) ; if ( $ this -> getCreated ( ) == null ) { $ this -> setCreated ( new \ DateTime ( date ( 'Y-m-d H:i:s' ) ) ) ; } }
Now we tell doctrine that before we persist or update we call the updatedTimestamps() function.
Now we tell doctrine that before we persist or update we call the updatedTimestamps () function .