BaseUser.php 733 B

123456789101112131415161718192021222324252627282930313233343536
  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 FOS\UserBundle\Entity\User as AbstractedUser;
  12. class BaseUser extends AbstractedUser
  13. {
  14. /**
  15. * @return \DateTime
  16. */
  17. public function getCredentialsExpireAt()
  18. {
  19. return $this->credentialsExpireAt;
  20. }
  21. public function setCredentialsExpireAt(\DateTime $date = null)
  22. {
  23. $this->credentialsExpireAt = $date;
  24. }
  25. public function __toString()
  26. {
  27. return $this->getUsername() ?: '-';
  28. }
  29. }