ControleOnline /
api-platform-common
| 1 | <?php |
||
| 2 | namespace ControleOnline\Entity; |
||
| 3 | |||
| 4 | use Symfony\Component\Serializer\Attribute\Groups; |
||
|
0 ignored issues
–
show
|
|||
| 5 | |||
| 6 | use ApiPlatform\Metadata\ApiResource; |
||
|
0 ignored issues
–
show
The type
ApiPlatform\Metadata\ApiResource was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 7 | use ApiPlatform\Metadata\ApiFilter; |
||
|
0 ignored issues
–
show
The type
ApiPlatform\Metadata\ApiFilter was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 8 | use ApiPlatform\Metadata\Get; |
||
|
0 ignored issues
–
show
The type
ApiPlatform\Metadata\Get was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 9 | use ApiPlatform\Metadata\GetCollection; |
||
|
0 ignored issues
–
show
The type
ApiPlatform\Metadata\GetCollection was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 10 | use ApiPlatform\Metadata\Post; |
||
|
0 ignored issues
–
show
The type
ApiPlatform\Metadata\Post was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 11 | use ApiPlatform\Metadata\Put; |
||
|
0 ignored issues
–
show
The type
ApiPlatform\Metadata\Put was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 12 | use ApiPlatform\Metadata\Delete; |
||
|
0 ignored issues
–
show
The type
ApiPlatform\Metadata\Delete was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 13 | use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
||
|
0 ignored issues
–
show
The type
ApiPlatform\Doctrine\Orm\Filter\SearchFilter was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 14 | use Doctrine\ORM\Mapping as ORM; |
||
|
0 ignored issues
–
show
The type
Doctrine\ORM\Mapping was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 15 | use Symfony\Component\Validator\Constraints as Assert; |
||
|
0 ignored issues
–
show
The type
Symfony\Component\Validator\Constraints was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 16 | use ControleOnline\Repository\StatusRepository; |
||
| 17 | use ControleOnline\Listener\LogListener; |
||
| 18 | |||
| 19 | #[ORM\Table(name: 'status')] |
||
| 20 | #[ORM\Index(name: 'IDX_real_status', columns: ['real_status'])] |
||
| 21 | #[ORM\UniqueConstraint(name: 'status', columns: ['status', 'context'])] |
||
| 22 | #[ORM\EntityListeners([LogListener::class])] |
||
| 23 | #[ORM\Entity(repositoryClass: StatusRepository::class)] |
||
| 24 | #[ApiResource( |
||
| 25 | formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
||
| 26 | normalizationContext: ['groups' => ['status:read']], |
||
| 27 | denormalizationContext: ['groups' => ['status:write']], |
||
| 28 | security: "is_granted('ROLE_CLIENT')", |
||
| 29 | operations: [ |
||
| 30 | new GetCollection(security: "is_granted('ROLE_CLIENT')"), |
||
| 31 | new Get(security: "is_granted('ROLE_CLIENT')"), |
||
| 32 | new Post(security: "is_granted('ROLE_CLIENT')"), |
||
| 33 | new Put( |
||
| 34 | security: "is_granted('ROLE_ADMIN') or is_granted('ROLE_CLIENT')", |
||
| 35 | validationContext: ['groups' => ['status:read']], |
||
| 36 | denormalizationContext: ['groups' => ['status:write']] |
||
| 37 | ), |
||
| 38 | new Delete(security: "is_granted('ROLE_CLIENT')") |
||
| 39 | ] |
||
| 40 | )] |
||
| 41 | #[ApiFilter(SearchFilter::class, properties: [ |
||
| 42 | 'id' => 'exact', |
||
| 43 | 'status' => 'exact', |
||
| 44 | 'realStatus' => 'exact', |
||
| 45 | 'visibility' => 'exact', |
||
| 46 | 'notify' => 'exact', |
||
| 47 | 'system' => 'exact', |
||
| 48 | 'color' => 'exact', |
||
| 49 | 'context' => 'exact' |
||
| 50 | ])] |
||
| 51 | class Status |
||
| 52 | { |
||
| 53 | #[ORM\Column(name: 'id', type: 'integer', nullable: false)] |
||
| 54 | #[ORM\Id] |
||
| 55 | #[ORM\GeneratedValue(strategy: 'IDENTITY')] |
||
| 56 | #[Groups([ |
||
| 57 | 'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write', |
||
| 58 | 'invoice:read', 'invoice_details:read', 'connections:read','status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read' |
||
| 59 | ])] |
||
| 60 | private $id; |
||
| 61 | |||
| 62 | #[ORM\Column(name: 'status', type: 'string', nullable: false)] |
||
| 63 | #[Groups([ |
||
| 64 | 'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write', |
||
| 65 | 'invoice:read', 'invoice_details:read', 'connections:read','status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read' |
||
| 66 | ])] |
||
| 67 | #[Assert\NotBlank] |
||
| 68 | #[Assert\Type(type: 'string')] |
||
| 69 | private $status; |
||
| 70 | |||
| 71 | #[ORM\Column(name: 'real_status', type: 'string', nullable: false)] |
||
| 72 | #[Groups([ |
||
| 73 | 'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write', |
||
| 74 | 'invoice:read', 'invoice_details:read', 'connections:read','status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read' |
||
| 75 | ])] |
||
| 76 | private $realStatus; |
||
| 77 | |||
| 78 | #[ORM\Column(name: 'visibility', type: 'string', nullable: false)] |
||
| 79 | #[Groups([ |
||
| 80 | 'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write', |
||
| 81 | 'invoice:read', 'invoice_details:read', 'connections:read','status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read' |
||
| 82 | ])] |
||
| 83 | private $visibility = 1; |
||
| 84 | |||
| 85 | #[ORM\Column(name: 'notify', type: 'boolean', nullable: false)] |
||
| 86 | #[Groups([ |
||
| 87 | 'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write', |
||
| 88 | 'invoice:read', 'invoice_details:read', 'connections:read','status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read' |
||
| 89 | ])] |
||
| 90 | private $notify = 1; |
||
| 91 | |||
| 92 | #[ORM\Column(name: 'system', type: 'boolean', nullable: false)] |
||
| 93 | #[Groups([ |
||
| 94 | 'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write', |
||
| 95 | 'invoice:read', 'invoice_details:read', 'connections:read','status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read' |
||
| 96 | ])] |
||
| 97 | private $system = 0; |
||
| 98 | |||
| 99 | #[ORM\Column(name: 'color', type: 'string', nullable: false)] |
||
| 100 | #[Groups([ |
||
| 101 | 'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write', |
||
| 102 | 'invoice:read', 'invoice_details:read', 'connections:read','status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read' |
||
| 103 | ])] |
||
| 104 | private $color = ''; |
||
| 105 | |||
| 106 | #[ORM\Column(name: 'context', type: 'string', nullable: false)] |
||
| 107 | #[Groups([ |
||
| 108 | 'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write', |
||
| 109 | 'invoice:read', 'invoice_details:read', 'connections:read','status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read' |
||
| 110 | ])] |
||
| 111 | private $context; |
||
| 112 | |||
| 113 | public function getId() |
||
| 114 | { |
||
| 115 | return $this->id; |
||
| 116 | } |
||
| 117 | |||
| 118 | public function setStatus($status) |
||
| 119 | { |
||
| 120 | $this->status = $status; |
||
| 121 | return $this; |
||
| 122 | } |
||
| 123 | |||
| 124 | public function getStatus() |
||
| 125 | { |
||
| 126 | return $this->status; |
||
| 127 | } |
||
| 128 | |||
| 129 | public function setRealStatus($real_status) |
||
| 130 | { |
||
| 131 | $this->realStatus = $real_status; |
||
| 132 | return $this; |
||
| 133 | } |
||
| 134 | |||
| 135 | public function getRealStatus() |
||
| 136 | { |
||
| 137 | return $this->realStatus; |
||
| 138 | } |
||
| 139 | |||
| 140 | public function setVisibility(string $visibility): self |
||
| 141 | { |
||
| 142 | $this->visibility = $visibility; |
||
| 143 | return $this; |
||
| 144 | } |
||
| 145 | |||
| 146 | public function getVisibility(): string |
||
| 147 | { |
||
| 148 | return $this->visibility; |
||
| 149 | } |
||
| 150 | |||
| 151 | public function setNotify($notify) |
||
| 152 | { |
||
| 153 | $this->notify = $notify; |
||
| 154 | return $this; |
||
| 155 | } |
||
| 156 | |||
| 157 | public function getNotify() |
||
| 158 | { |
||
| 159 | return $this->notify; |
||
| 160 | } |
||
| 161 | |||
| 162 | public function setSystem($system) |
||
| 163 | { |
||
| 164 | $this->system = $system; |
||
| 165 | return $this; |
||
| 166 | } |
||
| 167 | |||
| 168 | public function getSystem() |
||
| 169 | { |
||
| 170 | return $this->system; |
||
| 171 | } |
||
| 172 | |||
| 173 | public function setColor(string $color): self |
||
| 174 | { |
||
| 175 | $this->color = $color; |
||
| 176 | return $this; |
||
| 177 | } |
||
| 178 | |||
| 179 | public function getColor(): string |
||
| 180 | { |
||
| 181 | return $this->color; |
||
| 182 | } |
||
| 183 | |||
| 184 | public function setContext(string $context): self |
||
| 185 | { |
||
| 186 | $this->context = $context; |
||
| 187 | return $this; |
||
| 188 | } |
||
| 189 | |||
| 190 | public function getContext(): string |
||
| 191 | { |
||
| 192 | return $this->context; |
||
| 193 | } |
||
| 194 | } |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths