vendor/crosiersource/crosierlib-base/src/Entity/Logs/EntityChange.php line 61

Open in your IDE?
  1. <?php
  2. namespace CrosierSource\CrosierLibBaseBundle\Entity\Logs;
  3. use ApiPlatform\Core\Annotation\ApiFilter;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
  6. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  7. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  8. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\EntityHandler;
  9. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\NotUppercase;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. /**
  13.  * @ApiResource(
  14.  *     normalizationContext={"groups"={"entity","entityId"},"enable_max_depth"=true},
  15.  *     denormalizationContext={"groups"={"entity"},"enable_max_depth"=true},
  16.  *
  17.  *     itemOperations={
  18.  *          "get"={"path"="/core/config/entityChange/{id}", "security"="is_granted('ROLE_ENTITY_CHANGES')"},
  19.  *          "put"={"path"="/core/config/entityChange/{id}", "security"="is_granted('ROLE_ENTITY_CHANGES')"},
  20.  *          "delete"={"path"="/core/config/entityChange/{id}", "security"="is_granted('ROLE_ADMIN')"}
  21.  *     },
  22.  *     collectionOperations={
  23.  *          "get"={"path"="/core/config/entityChange", "security"="is_granted('ROLE_ENTITY_CHANGES')"},
  24.  *          "post"={"path"="/core/config/entityChange", "security"="is_granted('ROLE_ENTITY_CHANGES')"}
  25.  *     },
  26.  *
  27.  *     attributes={
  28.  *          "pagination_items_per_page"=10,
  29.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  30.  *     }
  31.  * )
  32.  *
  33.  * @ApiFilter(DateFilter::class, properties={"moment"})
  34.  * 
  35.  * @ApiFilter(SearchFilter::class, properties={
  36.  *     "entityClass": "partial", 
  37.  *     "entityId": "exact", 
  38.  *     "component": "partial", 
  39.  *     "act": "partial", 
  40.  *     "username": "partial", 
  41.  *     "obs": "partial"
  42.  * })
  43.  * @ApiFilter(OrderFilter::class, properties={
  44.  *     "id", 
  45.  *     "app", 
  46.  *     "component", 
  47.  *     "moment", 
  48.  *     "updated"
  49.  * }, arguments={"orderParameterName"="order"})
  50.  *
  51.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibBaseBundle\EntityHandler\Config\EntityChangeHandler")
  52.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibBaseBundle\Repository\Config\EntityChangeRepository")
  53.  * @ORM\Table(name="cfg_entity_change")
  54.  *
  55.  * @author Carlos Eduardo Pauluk
  56.  */
  57. class EntityChange
  58. {
  59.     /**
  60.      * @ORM\Id()
  61.      * @ORM\GeneratedValue()
  62.      * @ORM\Column(type="bigint")
  63.      * @Groups("entityId")
  64.      * @var null|int
  65.      */
  66.     public ?int $id null;
  67.     /**
  68.      * @ORM\Column(name="entity_class", type="string", nullable=false)
  69.      * @NotUppercase()
  70.      * @Groups("entity")
  71.      * @var null|string
  72.      */
  73.     public ?string $entityClass null;
  74.     /**
  75.      * @ORM\Column(name="entity_id", type="bigint", nullable=false)
  76.      * @Groups("entity")
  77.      * @var int|null
  78.      */
  79.     public ?int $entityId null;
  80.     /**
  81.      * @ORM\Column(name="changing_user_id", type="bigint", nullable=false)
  82.      * @Groups("entity")
  83.      * @var int|null
  84.      */
  85.     public ?int $changingUserId null;
  86.     /**
  87.      * @ORM\Column(name="changing_user_username", type="string", nullable=false)
  88.      * @Groups("entity")
  89.      * @var string|null
  90.      */
  91.     public ?string $changingUserUsername null;
  92.     /**
  93.      * @ORM\Column(name="changing_user_nome", type="string", nullable=false)
  94.      * @Groups("entity")
  95.      * @var string|null
  96.      */
  97.     public ?string $changingUserNome null;
  98.     /**
  99.      * @ORM\Column(name="changed_at", type="datetime", nullable=false)
  100.      * @Groups("entity")
  101.      * @var null|\DateTime
  102.      */
  103.     public ?\DateTime $changedAt null;
  104.     /**
  105.      * @ORM\Column(name="changes", type="string", nullable=false)
  106.      * @Groups("entity")
  107.      * @var string|null
  108.      */
  109.     public ?string $obs null;
  110. }