PreCreateEvent.php 510 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace PhpDevCommunity\PaperORM\Event;
  3. use PhpDevCommunity\Listener\Event;
  4. use PhpDevCommunity\PaperORM\Entity\EntityInterface;
  5. class PreCreateEvent extends Event
  6. {
  7. private EntityInterface $entity;
  8. /**
  9. * PreCreateEvent constructor.
  10. *
  11. * @param EntityInterface $entity
  12. */
  13. public function __construct(EntityInterface $entity)
  14. {
  15. $this->entity = $entity;
  16. }
  17. public function getEntity(): EntityInterface
  18. {
  19. return $this->entity;
  20. }
  21. }