BaseUser.php 743 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Sonata project.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\UserBundle\Entity;
  11. use Sonata\UserBundle\Model\User as AbstractedUser;
  12. /**
  13. * Represents a Base User Entity
  14. */
  15. class BaseUser extends AbstractedUser
  16. {
  17. /**
  18. * Hook on pre-persist operations
  19. */
  20. public function prePersist()
  21. {
  22. $this->createdAt = new \DateTime;
  23. $this->updatedAt = new \DateTime;
  24. }
  25. /**
  26. * Hook on pre-update operations
  27. */
  28. public function preUpdate()
  29. {
  30. $this->updatedAt = new \DateTime;
  31. }
  32. }