src/Entity/AbstractEntity.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Trait\ArchiveEntity;
  4. use App\Trait\LoggableEntity;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Timestampable\Traits\TimestampableEntity;
  7. /**
  8.  * @ORM\MappedSuperclass()
  9.  */
  10. abstract class AbstractEntity implements \JsonSerializable
  11. {
  12.     use TimestampableEntityLoggableEntityArchiveEntity;
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     protected $id;
  19.     public function getId(): int
  20.     {
  21.         return $this->id;
  22.     }
  23.     public function setId(?int $id): ?int
  24.     {
  25.         return $this->id=$id;
  26.     }
  27.     public function jsonSerialize(): array
  28.     {
  29.         return get_object_vars($this);
  30.     }
  31. }