| Total Complexity | 97 |
| Total Lines | 1326 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
Complex classes like People often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use People, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 62 | #[ApiResource( |
||
| 63 | operations: [ |
||
| 64 | |||
| 65 | new Get(security: 'is_granted(\'ROLE_CLIENT\')'), |
||
| 66 | |||
| 67 | new Get( |
||
| 68 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 69 | uriTemplate: '/people/{id}/contact', |
||
| 70 | controller: SearchContactAction::class |
||
| 71 | ), |
||
| 72 | new Post( |
||
| 73 | uriTemplate: '/people/{id}/add-user', |
||
| 74 | controller: CreateUserAction::class, |
||
| 75 | securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')', |
||
| 76 | ), |
||
| 77 | new Put( |
||
| 78 | security: 'is_granted(\'edit\', object)', |
||
| 79 | uriTemplate: '/people/{id}/profile/{component}', |
||
| 80 | requirements: ['component' => '^(phone|address|email|user|document|employee)+$'], |
||
| 81 | controller: UpdatePeopleProfileAction::class |
||
| 82 | ), |
||
| 83 | |||
| 84 | new Get( |
||
| 85 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 86 | uriTemplate: '/people/{id}/status', |
||
| 87 | controller: VerifyPeopleStatusAction::class |
||
| 88 | ), |
||
| 89 | |||
| 90 | new Get( |
||
| 91 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 92 | uriTemplate: '/people/{id}/classes', |
||
| 93 | controller: SearchClassesPeopleAction::class |
||
| 94 | ), |
||
| 95 | |||
| 96 | new Get( |
||
| 97 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 98 | uriTemplate: '/people/{id}/lessons', |
||
| 99 | controller: SearchLessonsPeopleAction::class |
||
| 100 | ), |
||
| 101 | new Put( |
||
| 102 | uriTemplate: '/customers/{id}/change-status', |
||
| 103 | controller: ChangeStatusAction::class, |
||
| 104 | requirements: ['id' => '^\\d+$'], |
||
| 105 | security: 'is_granted(\'edit\', object)' |
||
| 106 | ), |
||
| 107 | new Get( |
||
| 108 | uriTemplate: '/customers/{id}', |
||
| 109 | requirements: ['id' => '^\\d+$'], |
||
| 110 | security: 'is_granted(\'read\', object)' |
||
| 111 | ), |
||
| 112 | new Get( |
||
| 113 | uriTemplate: '/customers/{id}/employees', |
||
| 114 | requirements: ['id' => '^\\d+$'], |
||
| 115 | security: 'is_granted(\'read\', object)', |
||
| 116 | controller: AdminPersonEmployeesAction::class |
||
| 117 | ), |
||
| 118 | new Put( |
||
| 119 | uriTemplate: '/customers/{id}/employees', |
||
| 120 | requirements: ['id' => '^\\d+$'], |
||
| 121 | security: 'is_granted(\'edit\', object)', |
||
| 122 | controller: AdminPersonEmployeesAction::class |
||
| 123 | ), |
||
| 124 | new Delete( |
||
| 125 | uriTemplate: '/customers/{id}/employees', |
||
| 126 | requirements: ['id' => '^\\d+$'], |
||
| 127 | security: 'is_granted(\'delete\', object)', |
||
| 128 | controller: AdminPersonEmployeesAction::class |
||
| 129 | ), |
||
| 130 | new Get( |
||
| 131 | uriTemplate: '/customers/{id}/addresses', |
||
| 132 | requirements: ['id' => '^\\d+$'], |
||
| 133 | security: 'is_granted(\'read\', object)', |
||
| 134 | controller: AdminPersonAddressesAction::class |
||
| 135 | ), |
||
| 136 | new Put( |
||
| 137 | uriTemplate: '/customers/{id}/addresses', |
||
| 138 | requirements: ['id' => '^\\d+$'], |
||
| 139 | security: 'is_granted(\'edit\', object)', |
||
| 140 | controller: AdminPersonAddressesAction::class |
||
| 141 | ), |
||
| 142 | new Delete( |
||
| 143 | uriTemplate: '/customers/{id}/addresses', |
||
| 144 | requirements: ['id' => '^\\d+$'], |
||
| 145 | security: 'is_granted(\'delete\', object)', |
||
| 146 | controller: AdminPersonAddressesAction::class |
||
| 147 | ), |
||
| 148 | new Get( |
||
| 149 | uriTemplate: '/customers/{id}/documents', |
||
| 150 | requirements: ['id' => '^\\d+$'], |
||
| 151 | security: 'is_granted(\'read\', object)', |
||
| 152 | controller: AdminPersonDocumentsAction::class |
||
| 153 | ), |
||
| 154 | new Put( |
||
| 155 | uriTemplate: '/customers/{id}/documents', |
||
| 156 | requirements: ['id' => '^\\d+$'], |
||
| 157 | security: 'is_granted(\'edit\', object)', |
||
| 158 | controller: AdminPersonDocumentsAction::class |
||
| 159 | ), |
||
| 160 | new Delete( |
||
| 161 | uriTemplate: '/customers/{id}/documents', |
||
| 162 | requirements: ['id' => '^\\d+$'], |
||
| 163 | security: 'is_granted(\'delete\', object)', |
||
| 164 | controller: AdminPersonDocumentsAction::class |
||
| 165 | ), |
||
| 166 | new Get( |
||
| 167 | uriTemplate: '/customers/{id}/billing', |
||
| 168 | requirements: ['id' => '^\\d+$'], |
||
| 169 | security: 'is_granted(\'read\', object)', |
||
| 170 | controller: AdminPersonBillingAction::class |
||
| 171 | ), |
||
| 172 | new Put( |
||
| 173 | uriTemplate: '/customers/{id}/billing', |
||
| 174 | requirements: ['id' => '^\\d+$'], |
||
| 175 | security: 'is_granted(\'edit\', object)', |
||
| 176 | controller: AdminPersonBillingAction::class |
||
| 177 | ), |
||
| 178 | new Get( |
||
| 179 | uriTemplate: '/customers/{id}/phones', |
||
| 180 | requirements: ['id' => '^\\d+$'], |
||
| 181 | security: 'is_granted(\'read\', object)', |
||
| 182 | controller: AdminPersonPhonesAction::class |
||
| 183 | ), |
||
| 184 | new Put( |
||
| 185 | uriTemplate: '/customers/{id}/phones', |
||
| 186 | requirements: ['id' => '^\\d+$'], |
||
| 187 | security: 'is_granted(\'edit\', object)', |
||
| 188 | controller: AdminPersonPhonesAction::class |
||
| 189 | ), |
||
| 190 | new Delete( |
||
| 191 | uriTemplate: '/customers/{id}/phones', |
||
| 192 | requirements: ['id' => '^\\d+$'], |
||
| 193 | security: 'is_granted(\'delete\', object)', |
||
| 194 | controller: AdminPersonPhonesAction::class |
||
| 195 | ), |
||
| 196 | new Get( |
||
| 197 | uriTemplate: '/customers/{id}/emails', |
||
| 198 | requirements: ['id' => '^\\d+$'], |
||
| 199 | security: 'is_granted(\'read\', object)', |
||
| 200 | controller: AdminPersonEmailsAction::class |
||
| 201 | ), |
||
| 202 | new Put( |
||
| 203 | uriTemplate: '/customers/{id}/emails', |
||
| 204 | requirements: ['id' => '^\\d+$'], |
||
| 205 | security: 'is_granted(\'edit\', object)', |
||
| 206 | controller: AdminPersonEmailsAction::class |
||
| 207 | ), |
||
| 208 | new Delete( |
||
| 209 | uriTemplate: '/customers/{id}/emails', |
||
| 210 | requirements: ['id' => '^\\d+$'], |
||
| 211 | security: 'is_granted(\'delete\', object)', |
||
| 212 | controller: AdminPersonEmailsAction::class |
||
| 213 | ), |
||
| 214 | new Get( |
||
| 215 | uriTemplate: '/customers/{id}/users', |
||
| 216 | requirements: ['id' => '^\\d+$'], |
||
| 217 | security: 'is_granted(\'read\', object)', |
||
| 218 | controller: AdminPersonUsersAction::class |
||
| 219 | ), |
||
| 220 | new Put( |
||
| 221 | uriTemplate: '/customers/{id}/users', |
||
| 222 | requirements: ['id' => '^\\d+$'], |
||
| 223 | security: 'is_granted(\'edit\', object)', |
||
| 224 | controller: AdminPersonUsersAction::class |
||
| 225 | ), |
||
| 226 | new Delete( |
||
| 227 | uriTemplate: '/customers/{id}/users', |
||
| 228 | requirements: ['id' => '^\\d+$'], |
||
| 229 | security: 'is_granted(\'delete\', object)', |
||
| 230 | controller: AdminPersonUsersAction::class |
||
| 231 | ), |
||
| 232 | new Get( |
||
| 233 | uriTemplate: '/customers/{id}/salesman', |
||
| 234 | requirements: ['id' => '^\\d+$'], |
||
| 235 | security: 'is_granted(\'read\', object)', |
||
| 236 | controller: AdminCustomerSalesmanAction::class |
||
| 237 | ), |
||
| 238 | new Put( |
||
| 239 | uriTemplate: '/customers/{id}/salesman', |
||
| 240 | requirements: ['id' => '^\\d+$'], |
||
| 241 | security: 'is_granted(\'edit\', object)', |
||
| 242 | controller: AdminCustomerSalesmanAction::class |
||
| 243 | ), |
||
| 244 | new Delete( |
||
| 245 | uriTemplate: '/customers/{id}/salesman', |
||
| 246 | requirements: ['id' => '^\\d+$'], |
||
| 247 | security: 'is_granted(\'delete\', object)', |
||
| 248 | controller: AdminCustomerSalesmanAction::class |
||
| 249 | ), |
||
| 250 | new Get( |
||
| 251 | uriTemplate: '/customers/{id}/summary', |
||
| 252 | requirements: ['id' => '^\\d+$'], |
||
| 253 | security: 'is_granted(\'read\', object)', |
||
| 254 | controller: AdminPersonSummaryAction::class |
||
| 255 | ), |
||
| 256 | new Put( |
||
| 257 | uriTemplate: '/customers/{id}/summary', |
||
| 258 | requirements: ['id' => '^\\d+$'], |
||
| 259 | security: 'is_granted(\'edit\', object)', |
||
| 260 | controller: AdminPersonSummaryAction::class |
||
| 261 | ), |
||
| 262 | new Get( |
||
| 263 | uriTemplate: '/customers/{id}/files', |
||
| 264 | requirements: ['id' => '^\\d+$'], |
||
| 265 | security: 'is_granted(\'read\', object)', |
||
| 266 | controller: AdminPersonFilesAction::class |
||
| 267 | ), |
||
| 268 | new Get( |
||
| 269 | uriTemplate: '/customers/{id}/files/{fileId}', |
||
| 270 | requirements: ['id' => '^\\d+$', 'fileId' => '^\\d+$'], |
||
| 271 | security: 'is_granted(\'read\', object)', |
||
| 272 | controller: DownloadPersonFileAction::class |
||
| 273 | ), |
||
| 274 | new Delete( |
||
| 275 | uriTemplate: '/customers/{id}/files', |
||
| 276 | requirements: ['id' => '^\\d+$'], |
||
| 277 | security: 'is_granted(\'delete\', object)', |
||
| 278 | controller: AdminPersonFilesAction::class |
||
| 279 | ), |
||
| 280 | new Get( |
||
| 281 | uriTemplate: '/customers/{id}/companies', |
||
| 282 | requirements: ['id' => '^\\d+$'], |
||
| 283 | security: 'is_granted(\'read\', object)', |
||
| 284 | controller: AdminPersonCompaniesAction::class |
||
| 285 | ), |
||
| 286 | new Put( |
||
| 287 | uriTemplate: '/customers/{id}/companies', |
||
| 288 | requirements: ['id' => '^\\d+$'], |
||
| 289 | security: 'is_granted(\'edit\', object)', |
||
| 290 | controller: AdminPersonCompaniesAction::class |
||
| 291 | ), |
||
| 292 | new Delete( |
||
| 293 | uriTemplate: '/customers/{id}/companies', |
||
| 294 | requirements: ['id' => '^\\d+$'], |
||
| 295 | security: 'is_granted(\'delete\', object)', |
||
| 296 | controller: AdminPersonCompaniesAction::class |
||
| 297 | ), |
||
| 298 | new Get( |
||
| 299 | uriTemplate: '/professionals/{id}', |
||
| 300 | requirements: ['id' => '^\\d+$'], |
||
| 301 | security: 'is_granted(\'read\', object)' |
||
| 302 | ), |
||
| 303 | new Get( |
||
| 304 | uriTemplate: '/professionals/{id}/summary', |
||
| 305 | requirements: ['id' => '^\\d+$'], |
||
| 306 | security: 'is_granted(\'read\', object)', |
||
| 307 | controller: AdminPersonSummaryAction::class |
||
| 308 | ), |
||
| 309 | new Put( |
||
| 310 | uriTemplate: '/professionals/{id}/summary', |
||
| 311 | requirements: ['id' => '^\\d+$'], |
||
| 312 | security: 'is_granted(\'edit\', object)', |
||
| 313 | controller: AdminPersonSummaryAction::class |
||
| 314 | ), |
||
| 315 | new Get( |
||
| 316 | uriTemplate: '/professionals/{id}/employees', |
||
| 317 | requirements: ['id' => '^\\d+$'], |
||
| 318 | security: 'is_granted(\'read\', object)', |
||
| 319 | controller: AdminPersonEmployeesAction::class |
||
| 320 | ), |
||
| 321 | new Put( |
||
| 322 | uriTemplate: '/professionals/{id}/employees', |
||
| 323 | requirements: ['id' => '^\\d+$'], |
||
| 324 | security: 'is_granted(\'edit\', object)', |
||
| 325 | controller: AdminPersonEmployeesAction::class |
||
| 326 | ), |
||
| 327 | new Delete( |
||
| 328 | uriTemplate: '/professionals/{id}/employees', |
||
| 329 | requirements: ['id' => '^\\d+$'], |
||
| 330 | security: 'is_granted(\'delete\', object)', |
||
| 331 | controller: AdminPersonEmployeesAction::class |
||
| 332 | ), |
||
| 333 | new Get( |
||
| 334 | uriTemplate: '/professionals/{id}/addresses', |
||
| 335 | requirements: ['id' => '^\\d+$'], |
||
| 336 | security: 'is_granted(\'read\', object)', |
||
| 337 | controller: AdminPersonAddressesAction::class |
||
| 338 | ), |
||
| 339 | new Put( |
||
| 340 | uriTemplate: '/professionals/{id}/addresses', |
||
| 341 | requirements: ['id' => '^\\d+$'], |
||
| 342 | security: 'is_granted(\'edit\', object)', |
||
| 343 | controller: AdminPersonAddressesAction::class |
||
| 344 | ), |
||
| 345 | new Delete( |
||
| 346 | uriTemplate: '/professionals/{id}/addresses', |
||
| 347 | requirements: ['id' => '^\\d+$'], |
||
| 348 | security: 'is_granted(\'delete\', object)', |
||
| 349 | controller: AdminPersonAddressesAction::class |
||
| 350 | ), |
||
| 351 | new Get( |
||
| 352 | uriTemplate: '/professionals/{id}/documents', |
||
| 353 | requirements: ['id' => '^\\d+$'], |
||
| 354 | security: 'is_granted(\'read\', object)', |
||
| 355 | controller: AdminPersonDocumentsAction::class |
||
| 356 | ), |
||
| 357 | new Put( |
||
| 358 | uriTemplate: '/professionals/{id}/documents', |
||
| 359 | requirements: ['id' => '^\\d+$'], |
||
| 360 | security: 'is_granted(\'edit\', object)', |
||
| 361 | controller: AdminPersonDocumentsAction::class |
||
| 362 | ), |
||
| 363 | new Delete( |
||
| 364 | uriTemplate: '/professionals/{id}/documents', |
||
| 365 | requirements: ['id' => '^\\d+$'], |
||
| 366 | security: 'is_granted(\'delete\', object)', |
||
| 367 | controller: AdminPersonDocumentsAction::class |
||
| 368 | ), |
||
| 369 | new Get( |
||
| 370 | uriTemplate: '/professionals/{id}/emails', |
||
| 371 | requirements: ['id' => '^\\d+$'], |
||
| 372 | security: 'is_granted(\'read\', object)', |
||
| 373 | controller: AdminPersonEmailsAction::class |
||
| 374 | ), |
||
| 375 | new Put( |
||
| 376 | uriTemplate: '/professionals/{id}/emails', |
||
| 377 | requirements: ['id' => '^\\d+$'], |
||
| 378 | security: 'is_granted(\'edit\', object)', |
||
| 379 | controller: AdminPersonEmailsAction::class |
||
| 380 | ), |
||
| 381 | new Delete( |
||
| 382 | uriTemplate: '/professionals/{id}/emails', |
||
| 383 | requirements: ['id' => '^\\d+$'], |
||
| 384 | security: 'is_granted(\'delete\', object)', |
||
| 385 | controller: AdminPersonEmailsAction::class |
||
| 386 | ), |
||
| 387 | new Get( |
||
| 388 | uriTemplate: '/professionals/{id}/phones', |
||
| 389 | requirements: ['id' => '^\\d+$'], |
||
| 390 | security: 'is_granted(\'read\', object)', |
||
| 391 | controller: AdminPersonPhonesAction::class |
||
| 392 | ), |
||
| 393 | new Put( |
||
| 394 | uriTemplate: '/professionals/{id}/phones', |
||
| 395 | requirements: ['id' => '^\\d+$'], |
||
| 396 | security: 'is_granted(\'edit\', object)', |
||
| 397 | controller: AdminPersonPhonesAction::class |
||
| 398 | ), |
||
| 399 | new Delete( |
||
| 400 | uriTemplate: '/professionals/{id}/phones', |
||
| 401 | requirements: ['id' => '^\\d+$'], |
||
| 402 | security: 'is_granted(\'delete\', object)', |
||
| 403 | controller: AdminPersonPhonesAction::class |
||
| 404 | ), |
||
| 405 | new Get( |
||
| 406 | uriTemplate: '/professionals/{id}/billing', |
||
| 407 | requirements: ['id' => '^\\d+$'], |
||
| 408 | security: 'is_granted(\'read\', object)', |
||
| 409 | controller: AdminPersonBillingAction::class |
||
| 410 | ), |
||
| 411 | new Put( |
||
| 412 | uriTemplate: '/professionals/{id}/billing', |
||
| 413 | requirements: ['id' => '^\\d+$'], |
||
| 414 | security: 'is_granted(\'edit\', object)', |
||
| 415 | controller: AdminPersonBillingAction::class |
||
| 416 | ), |
||
| 417 | |||
| 418 | new Get( |
||
| 419 | uriTemplate: '/professionals/{id}/files', |
||
| 420 | requirements: ['id' => '^\\d+$'], |
||
| 421 | security: 'is_granted(\'read\', object)', |
||
| 422 | controller: AdminPersonFilesAction::class |
||
| 423 | ), |
||
| 424 | |||
| 425 | new Get( |
||
| 426 | uriTemplate: '/professionals/{id}/files/{fileId}', |
||
| 427 | requirements: ['id' => '^\\d+$', 'fileId' => '^\\d+$'], |
||
| 428 | security: 'is_granted(\'read\', object)', |
||
| 429 | controller: DownloadPersonFileAction::class |
||
| 430 | ), |
||
| 431 | |||
| 432 | new Delete( |
||
| 433 | uriTemplate: '/professionals/{id}/files', |
||
| 434 | requirements: ['id' => '^\\d+$'], |
||
| 435 | security: 'is_granted(\'delete\', object)', |
||
| 436 | controller: AdminPersonFilesAction::class |
||
| 437 | ), |
||
| 438 | |||
| 439 | new Get( |
||
| 440 | uriTemplate: '/professionals/{id}/users', |
||
| 441 | requirements: ['id' => '^\\d+$'], |
||
| 442 | security: 'is_granted(\'read\', object)', |
||
| 443 | controller: AdminPersonUsersAction::class |
||
| 444 | ), |
||
| 445 | |||
| 446 | new Put( |
||
| 447 | uriTemplate: '/professionals/{id}/users', |
||
| 448 | requirements: ['id' => '^\\d+$'], |
||
| 449 | security: 'is_granted(\'edit\', object)', |
||
| 450 | controller: AdminPersonUsersAction::class |
||
| 451 | ), |
||
| 452 | |||
| 453 | new Delete( |
||
| 454 | uriTemplate: '/professionals/{id}/users', |
||
| 455 | requirements: ['id' => '^\\d+$'], |
||
| 456 | security: 'is_granted(\'delete\', object)', |
||
| 457 | controller: AdminPersonUsersAction::class |
||
| 458 | ), |
||
| 459 | |||
| 460 | new Get( |
||
| 461 | uriTemplate: '/professionals/{id}/companies', |
||
| 462 | requirements: ['id' => '^\\d+$'], |
||
| 463 | security: 'is_granted(\'read\', object)', |
||
| 464 | controller: AdminPersonCompaniesAction::class |
||
| 465 | ), |
||
| 466 | |||
| 467 | new Put( |
||
| 468 | uriTemplate: '/professionals/{id}/companies', |
||
| 469 | requirements: ['id' => '^\\d+$'], |
||
| 470 | security: 'is_granted(\'edit\', object)', |
||
| 471 | controller: AdminPersonCompaniesAction::class |
||
| 472 | ), |
||
| 473 | |||
| 474 | new Delete( |
||
| 475 | uriTemplate: '/professionals/{id}/companies', |
||
| 476 | requirements: ['id' => '^\\d+$'], |
||
| 477 | security: 'is_granted(\'delete\', object)', |
||
| 478 | controller: AdminPersonCompaniesAction::class |
||
| 479 | ), |
||
| 480 | |||
| 481 | new GetCollection( |
||
| 482 | securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')', |
||
| 483 | uriTemplate: '/people' |
||
| 484 | ), |
||
| 485 | |||
| 486 | new GetCollection( |
||
| 487 | security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')', |
||
| 488 | uriTemplate: '/people/company/default', |
||
| 489 | controller: GetDefaultCompanyAction::class |
||
| 490 | ), |
||
| 491 | |||
| 492 | new Post( |
||
| 493 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 494 | uriTemplate: '/people/customer', |
||
| 495 | controller: CreatePeopleCustomerAction::class |
||
| 496 | ), |
||
| 497 | |||
| 498 | new GetCollection( |
||
| 499 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 500 | uriTemplate: '/customers', |
||
| 501 | controller: GetCustomerCollectionAction::class |
||
| 502 | ), |
||
| 503 | |||
| 504 | new GetCollection( |
||
| 505 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 506 | uriTemplate: '/customers/search-salesman', |
||
| 507 | controller: SearchCustomerSalesmanAction::class |
||
| 508 | ), |
||
| 509 | new Post( |
||
| 510 | uriTemplate: '/customers/files', |
||
| 511 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 512 | controller: UploadPersonFilesAction::class, |
||
| 513 | deserialize: false |
||
| 514 | ), |
||
| 515 | new Post( |
||
| 516 | uriTemplate: '/people/contact', |
||
| 517 | controller: CreateContactAction::class |
||
| 518 | ), |
||
| 519 | new GetCollection( |
||
| 520 | uriTemplate: '/people/companies/my', |
||
| 521 | controller: GetMyCompaniesAction::class |
||
| 522 | ), |
||
| 523 | new GetCollection( |
||
| 524 | uriTemplate: '/people/my-sale-companies', |
||
| 525 | controller: GetMySaleCompaniesAction::class |
||
| 526 | ), |
||
| 527 | new GetCollection( |
||
| 528 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 529 | uriTemplate: '/people-search', |
||
| 530 | controller: SearchPeopleAction::class |
||
| 531 | ), |
||
| 532 | new GetCollection( |
||
| 533 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 534 | uriTemplate: '/people/contact', |
||
| 535 | controller: SearchContactCompanyAction::class |
||
| 536 | ), |
||
| 537 | new GetCollection( |
||
| 538 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 539 | uriTemplate: '/people/client-company', |
||
| 540 | controller: GetClientCompanyAction::class |
||
| 541 | ), |
||
| 542 | new GetCollection( |
||
| 543 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 544 | uriTemplate: '/people/me', |
||
| 545 | controller: GetPeopleMeAction::class |
||
| 546 | ), |
||
| 547 | new GetCollection( |
||
| 548 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 549 | uriTemplate: '/tasks/people', |
||
| 550 | controller: ControleOnline\Entity\SearchTasksPeopleAction::class |
||
| 551 | ), |
||
| 552 | new GetCollection( |
||
| 553 | uriTemplate: '/people/professionals/close/{lat}/{lng}', |
||
| 554 | openapiContext: [], |
||
| 555 | controller: GetCloseProfessionalsAction::class |
||
| 556 | ), |
||
| 557 | new Post( |
||
| 558 | uriTemplate: '/professionals', |
||
| 559 | controller: CreateProfessionalAction::class, |
||
| 560 | securityPostDenormalize: 'is_granted(\'create\', object)' |
||
| 561 | ), |
||
| 562 | new GetCollection( |
||
| 563 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 564 | uriTemplate: '/professionals', |
||
| 565 | controller: GetProfessionalCollectionAction::class |
||
| 566 | ), |
||
| 567 | new Get( |
||
| 568 | uriTemplate: '/companies/{id}', |
||
| 569 | requirements: ['id' => '^\\d+$'], |
||
| 570 | security: 'is_granted(\'read\', object)' |
||
| 571 | ), |
||
| 572 | new Get( |
||
| 573 | uriTemplate: '/companies/{id}/salesman', |
||
| 574 | requirements: ['id' => '^\\d+$'], |
||
| 575 | security: 'is_granted(\'read\', object)', |
||
| 576 | controller: \App\Controller\AdminCompanySalesmanAction::class |
||
| 577 | ), |
||
| 578 | new Put( |
||
| 579 | uriTemplate: '/companies/{id}/salesman', |
||
| 580 | requirements: ['id' => '^\\d+$'], |
||
| 581 | security: 'is_granted(\'edit\', object)', |
||
| 582 | controller: \App\Controller\AdminCompanySalesmanAction::class |
||
| 583 | ), |
||
| 584 | new Delete( |
||
| 585 | uriTemplate: '/companies/{id}/salesman', |
||
| 586 | requirements: ['id' => '^\\d+$'], |
||
| 587 | security: 'is_granted(\'delete\', object)', |
||
| 588 | controller: \App\Controller\AdminCompanySalesmanAction::class |
||
| 589 | ), |
||
| 590 | new Get( |
||
| 591 | uriTemplate: '/clients/{id}', |
||
| 592 | requirements: ['id' => '^\\d+$'], |
||
| 593 | security: 'is_granted(\'ROLE_CLIENT\')' |
||
| 594 | ), |
||
| 595 | new Put( |
||
| 596 | uriTemplate: '/clients/{id}', |
||
| 597 | requirements: ['id' => '^\\d+$'], |
||
| 598 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 599 | controller: UpdateClientAction::class |
||
| 600 | ), new GetCollection( |
||
| 601 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 602 | uriTemplate: '/clients', |
||
| 603 | controller: GetClientCollectionAction::class |
||
| 604 | ), |
||
| 605 | new Post( |
||
| 606 | uriTemplate: '/clients', |
||
| 607 | controller: CreateClientAction::class |
||
| 608 | ) |
||
| 609 | ], |
||
| 610 | formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
||
| 611 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 612 | normalizationContext: ['groups' => ['people_read']], |
||
| 613 | denormalizationContext: ['groups' => ['people_write']] |
||
| 614 | )] |
||
| 615 | class People extends Person |
||
| 616 | { |
||
| 617 | /** |
||
| 618 | * @ORM\Column(type="integer", nullable=false) |
||
| 619 | * @ORM\Id |
||
| 620 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
| 621 | * @Groups({"category_read","pruduct_read","school_class:item:get","display_read", "people:people_company:subresource", "people_student:collection:get", |
||
| 622 | * "people_professional:collection:get", "task_read", "task_interaction_read","coupon_read","logistic_read","notifications_read","people_provider_read"}) |
||
| 623 | */ |
||
| 624 | private $id; |
||
| 625 | /** |
||
| 626 | * @ORM\Column(type="boolean", nullable=false) |
||
| 627 | */ |
||
| 628 | private $enable = 0; |
||
| 629 | /** |
||
| 630 | * @ORM\Column(type="boolean", nullable=false) |
||
| 631 | */ |
||
| 632 | private $icms = 1; |
||
| 633 | /** |
||
| 634 | * @ORM\Column(type="string", length=50, nullable=false) |
||
| 635 | * @Groups({ |
||
| 636 | * "category_read","order_read", "document_read", "email_read", "people_read", |
||
| 637 | * "invoice_read", "order_detail_status_read", "mycontract_read", |
||
| 638 | * "my_contract_item_read", "mycontractpeople_read", "school_class:item:get", |
||
| 639 | * "people:people_company:subresource", "people_student:collection:get", |
||
| 640 | * "people_professional:collection:get", "school_professional_weekly_read", "school_team_schedule_read", |
||
| 641 | * "school_team_schedule_read", "task_read", "task_interaction_read","coupon_read", "logistic_read", |
||
| 642 | * "queue_read","display_read","notifications_read","people_provider_read" |
||
| 643 | * }) |
||
| 644 | */ |
||
| 645 | private $name; |
||
| 646 | /** |
||
| 647 | * @ORM\Column(type="datetime", nullable=false, columnDefinition="DATETIME") |
||
| 648 | */ |
||
| 649 | private $registerDate; |
||
| 650 | /** |
||
| 651 | * @ORM\Column(type="string", length=50, nullable=false) |
||
| 652 | * @Groups({ |
||
| 653 | * "category_read","order_read", "document_read", "email_read", "people_read", "invoice_read", |
||
| 654 | * "order_detail_status_read", "mycontract_read", |
||
| 655 | * "my_contract_item_read", "mycontractpeople_read", "people:people_company:subresource", |
||
| 656 | * "school_professional_weekly_read", "school_team_schedule_read", "school_team_schedule_read", |
||
| 657 | * "people_professional:collection:get", "task_read", "task_interaction_read","coupon_read","logistic_read", |
||
| 658 | * "pruduct_read","queue_read","display_read","notifications_read","people_provider_read" |
||
| 659 | * }) |
||
| 660 | */ |
||
| 661 | private $alias; |
||
| 662 | /** |
||
| 663 | * @var string |
||
| 664 | * |
||
| 665 | * @ORM\Column(name="other_informations", type="json", nullable=true) |
||
| 666 | * @Groups({ |
||
| 667 | * "order_read", "document_read", "email_read", "people_read", "invoice_read", |
||
| 668 | * "order_detail_status_read", "mycontract_read", |
||
| 669 | * "my_contract_item_read", "mycontractpeople_read", "people:people_company:subresource", |
||
| 670 | * "school_professional_weekly_read", "school_team_schedule_read", "school_team_schedule_read", |
||
| 671 | * "people_professional:collection:get", "task_read", "task_interaction_read","coupon_read" |
||
| 672 | * }) |
||
| 673 | */ |
||
| 674 | private $otherInformations; |
||
| 675 | /** |
||
| 676 | * @ORM\Column(type="string", length=1, nullable=false) |
||
| 677 | * @Groups({"pruduct_read","display_read","people_read", "my_contract_item_read", "mycontractpeople_read", "task_read", "task_interaction_read"}) |
||
| 678 | */ |
||
| 679 | private $peopleType = 'F'; |
||
| 680 | /** |
||
| 681 | * @ORM\Column(type="float", nullable=false) |
||
| 682 | * @Groups({"people_read"}) |
||
| 683 | */ |
||
| 684 | private $billing = 0; |
||
| 685 | /** |
||
| 686 | * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File", inversedBy="people") |
||
| 687 | * @ORM\JoinColumns({ |
||
| 688 | * @ORM\JoinColumn(name="image_id", referencedColumnName="id") |
||
| 689 | * }) |
||
| 690 | * @Groups({"people_read","display_read"}) |
||
| 691 | */ |
||
| 692 | private $file; |
||
| 693 | /** |
||
| 694 | * @var Collection |
||
| 695 | * |
||
| 696 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Config", mappedBy="people") |
||
| 697 | * @ORM\OrderBy({"config_key" = "ASC"}) |
||
| 698 | */ |
||
| 699 | private $config; |
||
| 700 | /** |
||
| 701 | * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File") |
||
| 702 | * @ORM\JoinColumns({ |
||
| 703 | * @ORM\JoinColumn(name="alternative_image", referencedColumnName="id") |
||
| 704 | * }) |
||
| 705 | */ |
||
| 706 | private $alternativeFile; |
||
| 707 | /** |
||
| 708 | * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File") |
||
| 709 | * @ORM\JoinColumns({ |
||
| 710 | * @ORM\JoinColumn(name="background_image", referencedColumnName="id") |
||
| 711 | * }) |
||
| 712 | */ |
||
| 713 | private $backgroundFile; |
||
| 714 | /** |
||
| 715 | * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Language", inversedBy="people") |
||
| 716 | * @ORM\JoinColumns({ |
||
| 717 | * @ORM\JoinColumn(name="language_id", referencedColumnName="id") |
||
| 718 | * }) |
||
| 719 | */ |
||
| 720 | private $language; |
||
| 721 | /** |
||
| 722 | * @var Collection |
||
| 723 | * |
||
| 724 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Link\PeopleEmployee", mappedBy="company") |
||
| 725 | * @ORM\OrderBy({"employee" = "ASC"}) |
||
| 726 | */ |
||
| 727 | private $peopleEmployee; |
||
| 728 | /** |
||
| 729 | * @var \Collection |
||
| 730 | * @ORM\OneToMany (targetEntity="ControleOnline\Entity\Link\PeopleEmployee", mappedBy="employee") |
||
| 731 | * @ORM\OrderBy ({"company" = "ASC"}) |
||
| 732 | */ |
||
| 733 | private $peopleCompany; |
||
| 734 | /** |
||
| 735 | * @var Collection |
||
| 736 | * |
||
| 737 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\PeopleSalesman", mappedBy="company") |
||
| 738 | * @ORM\OrderBy({"salesman" = "ASC"}) |
||
| 739 | */ |
||
| 740 | private $peopleSalesman; |
||
| 741 | /** |
||
| 742 | * @var Collection |
||
| 743 | * |
||
| 744 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Link\PeopleFranchisee", mappedBy="franchisee") |
||
| 745 | * @ORM\OrderBy({"franchisee" = "ASC"}) |
||
| 746 | */ |
||
| 747 | private $peopleFranchisee; |
||
| 748 | /** |
||
| 749 | * @var Collection |
||
| 750 | * |
||
| 751 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Link\PeopleFranchisee", mappedBy="franchisor") |
||
| 752 | * @ORM\OrderBy({"franchisor" = "ASC"}) |
||
| 753 | */ |
||
| 754 | private $peopleFranchisor; |
||
| 755 | /** |
||
| 756 | * @var Collection |
||
| 757 | * |
||
| 758 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\User", mappedBy="people") |
||
| 759 | * @ORM\OrderBy({"username" = "ASC"}) |
||
| 760 | * @Groups({"people_read"}) |
||
| 761 | */ |
||
| 762 | private $user; |
||
| 763 | /** |
||
| 764 | * @var Collection |
||
| 765 | * |
||
| 766 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Document\Document", mappedBy="people") |
||
| 767 | * @Groups({"people_read", "task_interaction_read"}) |
||
| 768 | */ |
||
| 769 | private $document; |
||
| 770 | /** |
||
| 771 | * @var Collection |
||
| 772 | * |
||
| 773 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Address", mappedBy="people") |
||
| 774 | * @ORM\OrderBy({"nickname" = "ASC"}) |
||
| 775 | * @Groups({"people_read", "logistic_read"}) |
||
| 776 | */ |
||
| 777 | private $address; |
||
| 778 | /** |
||
| 779 | * @var Collection |
||
| 780 | * |
||
| 781 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Phone", mappedBy="people") |
||
| 782 | * @Groups({"people_read", "task_interaction_read"}) |
||
| 783 | */ |
||
| 784 | private $phone; |
||
| 785 | /** |
||
| 786 | * @var Collection |
||
| 787 | * |
||
| 788 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Email\Email", mappedBy="people") |
||
| 789 | * @Groups({"people_read", "get_contracts", "task_interaction_read"}) |
||
| 790 | */ |
||
| 791 | private $email; |
||
| 792 | /** |
||
| 793 | * Many Peoples have Many Contracts. |
||
| 794 | * |
||
| 795 | * @ORM\OneToMany (targetEntity="ControleOnline\Entity\ContractPeople", mappedBy="people") |
||
| 796 | */ |
||
| 797 | private $contractsPeople; |
||
| 798 | /** |
||
| 799 | * Many Peoples have Many Teams. |
||
| 800 | * |
||
| 801 | * @ORM\ManyToMany(targetEntity="ControleOnline\Entity\Team") |
||
| 802 | * @ORM\JoinTable(name="people_team", |
||
| 803 | * joinColumns={@ORM\JoinColumn(name="people_id", referencedColumnName="id")}, |
||
| 804 | * inverseJoinColumns={@ORM\JoinColumn(name="team_id", referencedColumnName="id")} |
||
| 805 | * ) |
||
| 806 | */ |
||
| 807 | private $teams; |
||
| 808 | /** |
||
| 809 | * @ORM\Column(type="string", length=255, nullable=false) |
||
| 810 | * @Groups({"people_read"}) |
||
| 811 | */ |
||
| 812 | private $billingDays; |
||
| 813 | /** |
||
| 814 | * @ORM\Column(type="integer", nullable=false) |
||
| 815 | * @Groups({"people_read", "my_contract_item_read", "mycontractpeople_read"}) |
||
| 816 | */ |
||
| 817 | private $paymentTerm; |
||
| 818 | /** |
||
| 819 | * @ORM\OneToOne(targetEntity=PeopleStudent::class, mappedBy="student", cascade={"persist", "remove"}) |
||
| 820 | */ |
||
| 821 | private $peopleStudent; |
||
| 822 | /** |
||
| 823 | * @ORM\OneToMany(targetEntity=PeopleStudent::class, mappedBy="company") |
||
| 824 | */ |
||
| 825 | private $peopleStudents; |
||
| 826 | /** |
||
| 827 | * @ORM\OneToOne(targetEntity=PeopleProfessional::class, mappedBy="professional", cascade={"persist", "remove"}) |
||
| 828 | */ |
||
| 829 | private $peopleProfessional; |
||
| 830 | /** |
||
| 831 | * @ORM\OneToMany(targetEntity=PeopleTeam::class, mappedBy="people") |
||
| 832 | */ |
||
| 833 | private $peopleTeams; |
||
| 834 | /** |
||
| 835 | * @ORM\Column(type="datetime", nullable=false, columnDefinition="DATETIME") |
||
| 836 | * @Groups({"people_read", "my_contract_item_read", "mycontractpeople_read"}) |
||
| 837 | */ |
||
| 838 | private $foundationDate = null; |
||
| 839 | /** |
||
| 840 | * @Groups({"people_read", "my_contract_item_read", "mycontractpeople_read"}) |
||
| 841 | */ |
||
| 842 | private $averageRating = 4; |
||
| 843 | public function __construct() |
||
| 844 | { |
||
| 845 | $this->enable = 0; |
||
| 846 | $this->icms = 1; |
||
| 847 | $this->billing = 0; |
||
| 848 | $this->registerDate = |
||
| 849 | new \DateTime('now'); |
||
| 850 | $this->peopleEmployee = |
||
| 851 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 852 | $this->config = |
||
| 853 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 854 | $this->peopleCompany = |
||
| 855 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 856 | $this->peopleSalesman = |
||
| 857 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 858 | $this->peopleFranchisee = |
||
| 859 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 860 | $this->peopleFranchisor = |
||
| 861 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 862 | $this->user = |
||
| 863 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 864 | $this->document = |
||
| 865 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 866 | $this->address = |
||
| 867 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 868 | $this->email = |
||
| 869 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 870 | $this->phone = |
||
| 871 | new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 872 | $this->billingDays = 'daily'; |
||
| 873 | $this->paymentTerm = 1; |
||
| 874 | $this->peopleStudents = |
||
| 875 | new ArrayCollection(); |
||
| 876 | $this->peopleTeams = |
||
| 877 | new ArrayCollection(); |
||
| 878 | $this->otherInformations = json_encode( |
||
| 879 | new stdClass() |
||
| 880 | ); |
||
| 881 | } |
||
| 882 | public function getId() |
||
| 883 | { |
||
| 884 | return $this->id; |
||
| 885 | } |
||
| 886 | public function getAverageRating() |
||
| 887 | { |
||
| 888 | return $this->averageRating; |
||
| 889 | } |
||
| 890 | public function setAverageRating($averageRating) |
||
| 891 | { |
||
| 892 | $this->averageRating = $averageRating; |
||
| 893 | return $this; |
||
| 894 | } |
||
| 895 | public function getIcms() |
||
| 896 | { |
||
| 897 | return $this->icms; |
||
| 898 | } |
||
| 899 | public function setIcms($icms) |
||
| 900 | { |
||
| 901 | $this->icms = $icms ?: 0; |
||
| 902 | return $this; |
||
| 903 | } |
||
| 904 | public function getEnabled() |
||
| 905 | { |
||
| 906 | return $this->enable; |
||
| 907 | } |
||
| 908 | public function setEnabled($enable) |
||
| 909 | { |
||
| 910 | $this->enable = $enable ?: 0; |
||
| 911 | return $this; |
||
| 912 | } |
||
| 913 | public function setPeopleType($people_type) |
||
| 914 | { |
||
| 915 | $this->peopleType = $people_type; |
||
| 916 | return $this; |
||
| 917 | } |
||
| 918 | public function getPeopleType() |
||
| 919 | { |
||
| 920 | return $this->peopleType; |
||
| 921 | } |
||
| 922 | /** |
||
| 923 | * Set name. |
||
| 924 | */ |
||
| 925 | public function setName(string $name): self |
||
| 926 | { |
||
| 927 | $this->name = $name; |
||
| 928 | return $this; |
||
| 929 | } |
||
| 930 | /** |
||
| 931 | * Get name. |
||
| 932 | */ |
||
| 933 | public function getName(): string |
||
| 934 | { |
||
| 935 | return strtoupper($this->name); |
||
| 936 | } |
||
| 937 | public function setAlias($alias) |
||
| 938 | { |
||
| 939 | $this->alias = $alias; |
||
| 940 | return $this; |
||
| 941 | } |
||
| 942 | public function getAlias() |
||
| 943 | { |
||
| 944 | return strtoupper($this->alias); |
||
| 945 | } |
||
| 946 | public function setFile(File $file = null) |
||
| 947 | { |
||
| 948 | $this->file = $file; |
||
| 949 | return $this; |
||
| 950 | } |
||
| 951 | public function getFile() |
||
| 952 | { |
||
| 953 | return $this->file; |
||
| 954 | } |
||
| 955 | public function setAlternativeFile(File $alternative_file = null) |
||
| 956 | { |
||
| 957 | $this->alternativeFile = $alternative_file; |
||
| 958 | return $this; |
||
| 959 | } |
||
| 960 | public function getAlternativeFile() |
||
| 961 | { |
||
| 962 | return $this->alternativeFile; |
||
| 963 | } |
||
| 964 | public function getBackgroundFile() |
||
| 965 | { |
||
| 966 | return $this->backgroundFile; |
||
| 967 | } |
||
| 968 | public function setBackgroundFile(File $backgroundFile = null) |
||
| 969 | { |
||
| 970 | $this->backgroundFile = $backgroundFile; |
||
| 971 | return $this; |
||
| 972 | } |
||
| 973 | public function setLanguage(Language $language = null) |
||
| 974 | { |
||
| 975 | $this->language = $language; |
||
| 976 | return $this; |
||
| 977 | } |
||
| 978 | public function getLanguage() |
||
| 979 | { |
||
| 980 | return $this->language; |
||
| 981 | } |
||
| 982 | public function setBilling($billing) |
||
| 983 | { |
||
| 984 | $this->billing = $billing; |
||
| 985 | return $this; |
||
| 986 | } |
||
| 987 | public function getBilling() |
||
| 988 | { |
||
| 989 | return $this->billing; |
||
| 990 | } |
||
| 991 | public function getRegisterDate(): \DateTimeInterface |
||
| 992 | { |
||
| 993 | return $this->registerDate; |
||
| 994 | } |
||
| 995 | public function setRegisterDate(\DateTimeInterface $registerDate): self |
||
| 996 | { |
||
| 997 | $this->registerDate = $registerDate; |
||
| 998 | return $this; |
||
| 999 | } |
||
| 1000 | /** |
||
| 1001 | * Add document. |
||
| 1002 | * |
||
| 1003 | * @return People |
||
| 1004 | */ |
||
| 1005 | public function addDocument(\ControleOnline\Entity\Document\Document $document) |
||
| 1006 | { |
||
| 1007 | $this->document[] = $document; |
||
| 1008 | return $this; |
||
| 1009 | } |
||
| 1010 | /** |
||
| 1011 | * Add peopleEmployee. |
||
| 1012 | * |
||
| 1013 | * @return People |
||
| 1014 | */ |
||
| 1015 | public function addPeopleEmployee(\ControleOnline\Entity\Link\PeopleEmployee $peopleEmployee) |
||
| 1016 | { |
||
| 1017 | $this->peopleEmployee[] = $peopleEmployee; |
||
| 1018 | return $this; |
||
| 1019 | } |
||
| 1020 | /** |
||
| 1021 | * Remove peopleEmployee. |
||
| 1022 | */ |
||
| 1023 | public function removePeopleEmployee(\ControleOnline\Entity\Link\PeopleEmployee $peopleEmployee) |
||
| 1024 | { |
||
| 1025 | $this->peopleEmployee->removeElement($peopleEmployee); |
||
| 1026 | } |
||
| 1027 | /** |
||
| 1028 | * Get peopleEmployee. |
||
| 1029 | * |
||
| 1030 | * @return Collection |
||
| 1031 | */ |
||
| 1032 | public function getPeopleEmployee() |
||
| 1033 | { |
||
| 1034 | return $this->peopleEmployee; |
||
| 1035 | } |
||
| 1036 | /** |
||
| 1037 | * Add peopleCompany. |
||
| 1038 | * |
||
| 1039 | * @return People |
||
| 1040 | */ |
||
| 1041 | public function addPeopleCompany(\ControleOnline\Entity\Link\PeopleEmployee $peopleCompany) |
||
| 1042 | { |
||
| 1043 | $this->peopleCompany[] = $peopleCompany; |
||
| 1044 | return $this; |
||
| 1045 | } |
||
| 1046 | /** |
||
| 1047 | * Remove peopleCompany. |
||
| 1048 | * |
||
| 1049 | * @param \Core\Entity\PeopleCompany $peopleCompany |
||
| 1050 | */ |
||
| 1051 | public function removePeopleCompany(\ControleOnline\Entity\Link\PeopleEmployee $peopleCompany) |
||
| 1052 | { |
||
| 1053 | $this->peopleCompany->removeElement($peopleCompany); |
||
| 1054 | } |
||
| 1055 | /** |
||
| 1056 | * Get peopleCompany. |
||
| 1057 | * |
||
| 1058 | * @return Collection |
||
| 1059 | */ |
||
| 1060 | public function getPeopleCompany() |
||
| 1061 | { |
||
| 1062 | return $this->peopleCompany; |
||
| 1063 | } |
||
| 1064 | /** |
||
| 1065 | * Get peopleFranchisor. |
||
| 1066 | * |
||
| 1067 | * @return Collection |
||
| 1068 | */ |
||
| 1069 | public function getPeopleFranchisor() |
||
| 1070 | { |
||
| 1071 | return $this->peopleFranchisor; |
||
| 1072 | } |
||
| 1073 | /** |
||
| 1074 | * Get peopleFranchisee. |
||
| 1075 | * |
||
| 1076 | * @return Collection |
||
| 1077 | */ |
||
| 1078 | public function getPeopleFranchisee() |
||
| 1079 | { |
||
| 1080 | return $this->peopleFranchisee; |
||
| 1081 | } |
||
| 1082 | /** |
||
| 1083 | * Get peopleSalesman. |
||
| 1084 | * |
||
| 1085 | * @return Collection |
||
| 1086 | */ |
||
| 1087 | public function getPeopleSalesman() |
||
| 1088 | { |
||
| 1089 | return $this->peopleSalesman; |
||
| 1090 | } |
||
| 1091 | /** |
||
| 1092 | * Add user. |
||
| 1093 | * |
||
| 1094 | * @return People |
||
| 1095 | */ |
||
| 1096 | public function addUser(\ControleOnline\Entity\User $user) |
||
| 1097 | { |
||
| 1098 | $this->user[] = $user; |
||
| 1099 | return $this; |
||
| 1100 | } |
||
| 1101 | /** |
||
| 1102 | * Remove user. |
||
| 1103 | */ |
||
| 1104 | public function removeUser(\ControleOnline\Entity\User $user) |
||
| 1105 | { |
||
| 1106 | $this->user->removeElement($user); |
||
| 1107 | } |
||
| 1108 | /** |
||
| 1109 | * Get user. |
||
| 1110 | * |
||
| 1111 | * @return Collection |
||
| 1112 | */ |
||
| 1113 | public function getUser() |
||
| 1114 | { |
||
| 1115 | return $this->user; |
||
| 1116 | } |
||
| 1117 | /** |
||
| 1118 | * Get document. |
||
| 1119 | * |
||
| 1120 | * @return Collection |
||
| 1121 | */ |
||
| 1122 | public function getDocument() |
||
| 1123 | { |
||
| 1124 | return $this->document; |
||
| 1125 | } |
||
| 1126 | /** |
||
| 1127 | * Get address. |
||
| 1128 | * |
||
| 1129 | * @return Collection |
||
| 1130 | */ |
||
| 1131 | public function getAddress() |
||
| 1132 | { |
||
| 1133 | return $this->address; |
||
| 1134 | } |
||
| 1135 | /** |
||
| 1136 | * Get document. |
||
| 1137 | * |
||
| 1138 | * @return Collection |
||
| 1139 | */ |
||
| 1140 | public function getPhone() |
||
| 1141 | { |
||
| 1142 | return $this->phone; |
||
| 1143 | } |
||
| 1144 | /** |
||
| 1145 | * Get email. |
||
| 1146 | * |
||
| 1147 | * @return Collection |
||
| 1148 | */ |
||
| 1149 | public function getEmail() |
||
| 1150 | { |
||
| 1151 | return $this->email; |
||
| 1152 | } |
||
| 1153 | public function getContractsPeople(): Collection |
||
| 1154 | { |
||
| 1155 | return $this->contractsPeople; |
||
| 1156 | } |
||
| 1157 | public function getTeams(): Collection |
||
| 1158 | { |
||
| 1159 | return $this->teams; |
||
| 1160 | } |
||
| 1161 | public function getUpcomingClass($date): SchoolClass |
||
| 1162 | { |
||
| 1163 | foreach ($this->getTeams() as $team) { |
||
| 1164 | $schoolClass = $team->getSchoolClass($date); |
||
| 1165 | if ('Scheduled' === $schoolClass->getSchoolClassStatus()->getLessonStatus()) { |
||
| 1166 | return $schoolClass; |
||
| 1167 | } |
||
| 1168 | } |
||
| 1169 | return |
||
| 1170 | new SchoolClass(); |
||
| 1171 | } |
||
| 1172 | public function getClasses(): Collection |
||
| 1173 | { |
||
| 1174 | $classes = |
||
| 1175 | new ArrayCollection(); |
||
| 1176 | foreach ($this->getTeams() as $team) { |
||
| 1177 | $classes->add($team->getSchoolClass()); |
||
| 1178 | } |
||
| 1179 | return $classes; |
||
| 1180 | } |
||
| 1181 | public function getLessons(): Collection |
||
| 1182 | { |
||
| 1183 | $lessons = |
||
| 1184 | new ArrayCollection(); |
||
| 1185 | foreach ($this->getClasses() as $class) { |
||
| 1186 | foreach ($class->getLessons() as $lesson) { |
||
| 1187 | $lessons->add($lesson); |
||
| 1188 | } |
||
| 1189 | } |
||
| 1190 | return $lessons; |
||
| 1191 | } |
||
| 1192 | public function setBillingDays(string $billingDays): self |
||
| 1193 | { |
||
| 1194 | $this->billingDays = $billingDays; |
||
| 1195 | return $this; |
||
| 1196 | } |
||
| 1197 | public function getBillingDays(): string |
||
| 1198 | { |
||
| 1199 | return $this->billingDays; |
||
| 1200 | } |
||
| 1201 | public function setPaymentTerm(int $paymentTerm): self |
||
| 1202 | { |
||
| 1203 | $this->paymentTerm = $paymentTerm; |
||
| 1204 | return $this; |
||
| 1205 | } |
||
| 1206 | public function getPaymentTerm(): int |
||
| 1207 | { |
||
| 1208 | return $this->paymentTerm; |
||
| 1209 | } |
||
| 1210 | public function getPeopleStudent(): ?PeopleStudent |
||
| 1211 | { |
||
| 1212 | return $this->peopleStudent; |
||
| 1213 | } |
||
| 1214 | public function setPeopleStudent(PeopleStudent $peopleStudent): self |
||
| 1215 | { |
||
| 1216 | $this->peopleStudent = $peopleStudent; |
||
| 1217 | // set the owning side of the relation if necessary |
||
| 1218 | if ($peopleStudent->getStudent() !== $this) { |
||
| 1219 | $peopleStudent->setStudent($this); |
||
| 1220 | } |
||
| 1221 | return $this; |
||
| 1222 | } |
||
| 1223 | /** |
||
| 1224 | * @return Collection|PeopleStudent[] |
||
| 1225 | */ |
||
| 1226 | public function getPeopleStudents(): Collection |
||
| 1227 | { |
||
| 1228 | return $this->peopleStudents; |
||
| 1229 | } |
||
| 1230 | public function addPeopleStudent(PeopleStudent $peopleStudent): self |
||
| 1231 | { |
||
| 1232 | if (!$this->peopleStudents->contains($peopleStudent)) { |
||
| 1233 | $this->peopleStudents[] = $peopleStudent; |
||
| 1234 | $peopleStudent->setCompany($this); |
||
| 1235 | } |
||
| 1236 | return $this; |
||
| 1237 | } |
||
| 1238 | public function removePeopleStudent(PeopleStudent $peopleStudent): self |
||
| 1239 | { |
||
| 1240 | if ($this->peopleStudents->removeElement($peopleStudent)) { |
||
| 1241 | // set the owning side to null (unless already changed) |
||
| 1242 | if ($peopleStudent->getCompany() === $this) { |
||
| 1243 | $peopleStudent->setCompany(null); |
||
| 1244 | } |
||
| 1245 | } |
||
| 1246 | return $this; |
||
| 1247 | } |
||
| 1248 | public function getPeopleProfessional(): ?PeopleProfessional |
||
| 1249 | { |
||
| 1250 | return $this->peopleProfessional; |
||
| 1251 | } |
||
| 1252 | public function setPeopleProfessional(PeopleProfessional $peopleProfessional): self |
||
| 1253 | { |
||
| 1254 | $this->peopleProfessional = $peopleProfessional; |
||
| 1255 | // set the owning side of the relation if necessary |
||
| 1256 | if ($peopleProfessional->getProfessional() !== $this) { |
||
| 1257 | $peopleProfessional->setProfessional($this); |
||
| 1258 | } |
||
| 1259 | return $this; |
||
| 1260 | } |
||
| 1261 | /** |
||
| 1262 | * @return Collection|PeopleTeam[] |
||
| 1263 | */ |
||
| 1264 | public function getPeopleTeams(): Collection |
||
| 1265 | { |
||
| 1266 | return $this->peopleTeams; |
||
| 1267 | } |
||
| 1268 | public function addPeopleTeam(PeopleTeam $peopleTeam): self |
||
| 1269 | { |
||
| 1270 | if (!$this->peopleTeams->contains($peopleTeam)) { |
||
| 1271 | $this->peopleTeams[] = $peopleTeam; |
||
| 1272 | $peopleTeam->setPeople($this); |
||
| 1273 | } |
||
| 1274 | return $this; |
||
| 1275 | } |
||
| 1276 | public function removePeopleTeam(PeopleTeam $peopleTeam): self |
||
| 1277 | { |
||
| 1278 | if ($this->peopleTeams->removeElement($peopleTeam)) { |
||
| 1279 | // set the owning side to null (unless already changed) |
||
| 1280 | if ($peopleTeam->getPeople() === $this) { |
||
| 1281 | $peopleTeam->setPeople(null); |
||
| 1282 | } |
||
| 1283 | } |
||
| 1284 | return $this; |
||
| 1285 | } |
||
| 1286 | public function getFoundationDate(): ?\DateTime |
||
| 1287 | { |
||
| 1288 | return $this->foundationDate; |
||
| 1289 | } |
||
| 1290 | public function setFoundationDate(\DateTimeInterface $date): self |
||
| 1291 | { |
||
| 1292 | $this->foundationDate = $date; |
||
| 1293 | return $this; |
||
| 1294 | } |
||
| 1295 | public function getFullName(): string |
||
| 1296 | { |
||
| 1297 | if ($this->getPeopleType() == 'F') { |
||
| 1298 | return trim(preg_replace('/[^A-Za-z\s]/', '', sprintf('%s %s', $this->getName(), $this->getAlias()))); |
||
| 1299 | } |
||
| 1300 | return trim(preg_replace('/[^A-Za-z\s]/', '', $this->getName())); |
||
| 1301 | } |
||
| 1302 | public function isPerson(): bool |
||
| 1303 | { |
||
| 1304 | return $this->getPeopleType() == 'F'; |
||
| 1305 | } |
||
| 1306 | public function getOneEmail(): ?Email |
||
| 1307 | { |
||
| 1308 | if (($email = $this->getEmail()->first()) === false) { |
||
| 1309 | return null; |
||
| 1310 | } |
||
| 1311 | return $email; |
||
| 1312 | } |
||
| 1313 | public function getOneDocument(): ?Document |
||
| 1314 | { |
||
| 1315 | $documents = $this->getDocument()->filter(function ($peopleDocument) { |
||
| 1316 | if ($peopleDocument->getPeople()->getPeopleType() == 'F') { |
||
| 1317 | return $peopleDocument->getDocumentType()->getDocumentType() == 'CPF'; |
||
| 1318 | } |
||
| 1319 | return $peopleDocument->getDocumentType()->getDocumentType() == 'CNPJ'; |
||
| 1320 | }); |
||
| 1321 | return ($document = $documents->first()) === false ? null : $document; |
||
| 1322 | } |
||
| 1323 | public function getBirthdayAsString(): ?string |
||
| 1324 | { |
||
| 1325 | if ($this->getFoundationDate() instanceof \DateTimeInterface) { |
||
| 1326 | return $this->getFoundationDate()->format('Y-m-d'); |
||
| 1327 | } |
||
| 1328 | return null; |
||
| 1329 | } |
||
| 1330 | /** |
||
| 1331 | * Get otherInformations |
||
| 1332 | * |
||
| 1333 | * @return stdClass |
||
| 1334 | */ |
||
| 1335 | public function getOtherInformations($decode = false) |
||
| 1338 | } |
||
| 1339 | /** |
||
| 1340 | * Set comments |
||
| 1341 | * |
||
| 1342 | * @param string $otherInformations |
||
| 1343 | * @return Order |
||
| 1344 | */ |
||
| 1345 | public function addOtherInformations($key, $value) |
||
| 1346 | { |
||
| 1347 | $otherInformations = $this->getOtherInformations(true); |
||
| 1348 | $otherInformations->{$key} = $value; |
||
| 1349 | $this->otherInformations = json_encode($otherInformations); |
||
| 1351 | } |
||
| 1352 | /** |
||
| 1353 | * Set comments |
||
| 1354 | * |
||
| 1355 | * @param string $otherInformations |
||
| 1356 | * @return Order |
||
| 1357 | */ |
||
| 1358 | public function setOtherInformations(stdClass $otherInformations) |
||
| 1359 | { |
||
| 1360 | $this->otherInformations = json_encode($otherInformations); |
||
| 1361 | return $this; |
||
| 1362 | } |
||
| 1363 | /** |
||
| 1364 | * Add Config. |
||
| 1365 | * |
||
| 1366 | * @return People |
||
| 1367 | */ |
||
| 1368 | public function addConfig(\ControleOnline\Entity\Config $config) |
||
| 1369 | { |
||
| 1370 | $this->config[] = $config; |
||
| 1371 | return $this; |
||
| 1372 | } |
||
| 1373 | /** |
||
| 1374 | * Remove Config. |
||
| 1375 | */ |
||
| 1376 | public function removeConfig(\ControleOnline\Entity\Config $config) |
||
| 1379 | } |
||
| 1380 | /** |
||
| 1381 | * Get config. |
||
| 1382 | * |
||
| 1383 | * @return Collection |
||
| 1384 | */ |
||
| 1385 | public function getConfig() |
||
| 1388 | } |
||
| 1389 | } |
||
| 1390 |
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