vendor/sonata-project/media-bundle/src/Entity/BaseGallery.php line 22

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\Gallery;
  13. /**
  14. * @phpstan-template T of \Sonata\MediaBundle\Model\GalleryItemInterface
  15. * @phpstan-extends Gallery<T>
  16. */
  17. abstract class BaseGallery extends Gallery
  18. {
  19. public function prePersist(): void
  20. {
  21. $this->createdAt = new \DateTime();
  22. $this->updatedAt = new \DateTime();
  23. }
  24. public function preUpdate(): void
  25. {
  26. $this->updatedAt = new \DateTime();
  27. }
  28. }