vendor/sonata-project/media-bundle/src/Entity/BaseMedia.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of the Sonata Project package.
  5. *
  6. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Sonata\MediaBundle\Entity;
  12. use Sonata\MediaBundle\Model\Media;
  13. abstract class BaseMedia extends Media
  14. {
  15. public function prePersist(): void
  16. {
  17. $this->createdAt = new \DateTime();
  18. $this->updatedAt = new \DateTime();
  19. }
  20. public function preUpdate(): void
  21. {
  22. $this->updatedAt = new \DateTime();
  23. }
  24. }