| Total Complexity | 4 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | trait Blameable |
||
| 23 | { |
||
| 24 | #[ORM\ManyToOne( |
||
| 25 | targetEntity: User::class, |
||
| 26 | )] |
||
| 27 | #[ORM\JoinColumn( |
||
| 28 | name: 'created_by_id', |
||
| 29 | referencedColumnName: 'id', |
||
| 30 | nullable: true, |
||
| 31 | onDelete: 'SET NULL', |
||
| 32 | )] |
||
| 33 | #[Gedmo\Blameable( |
||
| 34 | on: 'create', |
||
| 35 | )] |
||
| 36 | #[Groups([ |
||
| 37 | 'ApiKey.createdBy', |
||
| 38 | 'Role.createdBy', |
||
| 39 | 'User.createdBy', |
||
| 40 | 'UserGroup.createdBy', |
||
| 41 | ])] |
||
| 42 | protected ?User $createdBy = null; |
||
| 43 | |||
| 44 | #[ORM\ManyToOne( |
||
| 45 | targetEntity: User::class, |
||
| 46 | )] |
||
| 47 | #[ORM\JoinColumn( |
||
| 48 | name: 'updated_by_id', |
||
| 49 | referencedColumnName: 'id', |
||
| 50 | nullable: true, |
||
| 51 | onDelete: 'SET NULL', |
||
| 52 | )] |
||
| 53 | #[Gedmo\Blameable( |
||
| 54 | on: 'update', |
||
| 55 | )] |
||
| 56 | #[Groups([ |
||
| 57 | 'ApiKey.updatedBy', |
||
| 58 | 'Role.updatedBy', |
||
| 59 | 'User.updatedBy', |
||
| 60 | 'UserGroup.updatedBy', |
||
| 61 | ])] |
||
| 62 | protected ?User $updatedBy = null; |
||
| 63 | |||
| 64 | 4 | public function getCreatedBy(): ?User |
|
| 65 | { |
||
| 66 | 4 | return $this->createdBy; |
|
| 67 | } |
||
| 68 | |||
| 69 | 8 | public function setCreatedBy(?User $createdBy = null): self |
|
| 70 | { |
||
| 71 | 8 | $this->createdBy = $createdBy; |
|
| 72 | |||
| 73 | 8 | return $this; |
|
| 74 | } |
||
| 75 | |||
| 76 | 4 | public function getUpdatedBy(): ?User |
|
| 77 | { |
||
| 78 | 4 | return $this->updatedBy; |
|
| 79 | } |
||
| 80 | |||
| 81 | 8 | public function setUpdatedBy(?User $updatedBy = null): self |
|
| 86 | } |
||
| 87 | } |
||
| 88 |