vendor/lexik/translation-bundle/Entity/File.php line 14

Open in your IDE?
  1. <?php
  2. namespace Lexik\Bundle\TranslationBundle\Entity;
  3. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  4. use Lexik\Bundle\TranslationBundle\Model\File as FileModel;
  5. use Lexik\Bundle\TranslationBundle\Manager\FileInterface;
  6. /**
  7. * @UniqueEntity(fields={"hash"})
  8. *
  9. * @author Cédric Girard <c.girard@lexik.fr>
  10. */
  11. class File extends FileModel implements FileInterface
  12. {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function prePersist()
  17. {
  18. $this->createdAt = new \DateTime("now");
  19. $this->updatedAt = new \DateTime("now");
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function preUpdate()
  25. {
  26. $this->updatedAt = new \DateTime("now");
  27. }
  28. }