123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- /*
- * This file is part of the Sonata project.
- *
- * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace Sonata\UserBundle\Entity;
- use FOS\UserBundle\Entity\User as AbstractedUser;
- class BaseUser extends AbstractedUser
- {
- protected $createdAt;
- protected $updatedAt;
- /**
- * Set createdAt
- *
- * @param \DateTime $createdAt
- */
- public function setCreatedAt(\DateTime $createdAt = null)
- {
- $this->createdAt = $createdAt;
- }
- /**
- * Get createdAt
- *
- * @return \DateTime $createdAt
- */
- public function getCreatedAt()
- {
- return $this->createdAt;
- }
- /**
- * Set updatedAt
- *
- * @param \DateTime $updatedAt
- */
- public function setUpdatedAt(\DateTime $updatedAt = null)
- {
- $this->updatedAt = $updatedAt;
- }
- /**
- * Get updatedAt
- *
- * @return \DateTime $updatedAt
- */
- public function getUpdatedAt()
- {
- return $this->updatedAt;
- }
- public function prePersist()
- {
- $this->createdAt = new \DateTime;
- $this->updatedAt = new \DateTime;
- }
- public function preUpdate()
- {
- $this->updatedAt = new \DateTime;
- }
- /**
- * @return \DateTime
- */
- public function getCredentialsExpireAt()
- {
- return $this->credentialsExpireAt;
- }
- public function setCredentialsExpireAt(\DateTime $date = null)
- {
- $this->credentialsExpireAt = $date;
- }
- public function __toString()
- {
- return $this->getUsername() ?: '-';
- }
- }
|