1 | <?php |
||
25 | class Journal implements EntityInterface |
||
26 | { |
||
27 | use Traits\PropertyIdGeneratedTrait; |
||
28 | |||
29 | //------------------------------------------------------------------------------------------- |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | * @ORM\Column(name="type", type="string", length=50, nullable=false) |
||
34 | * |
||
35 | * @Assert\NotBlank() |
||
36 | * @Assert\Choice(callback={"App\Enum\Entity\JournalTypeEnum", "toArray"}) |
||
37 | * @Assert\Length(min="1", max="50") |
||
38 | */ |
||
39 | private $type; |
||
40 | |||
41 | //------------------------------------------------------------------------------------------- |
||
42 | /** |
||
43 | * @var ArrayCollection|JournalMove[] |
||
44 | * @ORM\OneToMany(targetEntity="App\Entity\Accounting\JournalMove", mappedBy="journal") |
||
45 | */ |
||
46 | private $journalMoves; |
||
47 | |||
48 | /** |
||
49 | * @var Task |
||
50 | * @ORM\ManyToOne(targetEntity="App\Entity\Accounting\Task", inversedBy="journals") |
||
51 | * @ORM\JoinColumn(name="journal_id", referencedColumnName="id", nullable=false) |
||
52 | * |
||
53 | * @Assert\NotNull() |
||
54 | */ |
||
55 | private $task; |
||
56 | |||
57 | //------------------------------------------------------------------------------------------- |
||
58 | |||
59 | public function __construct(Task $task, JournalTypeEnum $type) |
||
66 | |||
67 | //------------------------------------------------------------------------------------------- |
||
68 | |||
69 | public function getType(): JournalTypeEnum |
||
73 | |||
74 | public function getTask(): Task |
||
78 | |||
79 | /** |
||
80 | * @return JournalMove[]|ArrayCollection |
||
81 | */ |
||
82 | public function getJournalMoves(): ArrayCollection |
||
86 | } |
||
87 |