BaseUser.php 833 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project package.
  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\Document;
  11. use Sonata\UserBundle\Model\User as AbstractedUser;
  12. use Sonata\UserBundle\Model\UserInterface;
  13. /**
  14. * Represents a Base User Document.
  15. */
  16. class BaseUser extends AbstractedUser implements UserInterface
  17. {
  18. /**
  19. * Hook on pre-persist operations.
  20. */
  21. public function prePersist()
  22. {
  23. $this->createdAt = new \DateTime();
  24. $this->updatedAt = new \DateTime();
  25. }
  26. /**
  27. * Hook on pre-update operations.
  28. */
  29. public function preUpdate()
  30. {
  31. $this->updatedAt = new \DateTime();
  32. }
  33. }