|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Application\Model; |
|
6
|
|
|
|
|
7
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
8
|
|
|
use GraphQL\Doctrine\Annotation as API; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* A document attesting an expense claim |
|
12
|
|
|
* |
|
13
|
|
|
* @ORM\HasLifecycleCallbacks |
|
14
|
|
|
* @ORM\Entity(repositoryClass="Application\Repository\AccountingDocumentRepository") |
|
15
|
|
|
* @ORM\Table(uniqueConstraints={ |
|
16
|
|
|
* @ORM\UniqueConstraint(name="unique_name", columns={"filename"}) |
|
17
|
|
|
* }) |
|
18
|
|
|
*/ |
|
19
|
|
|
class AccountingDocument extends AbstractModel implements \Ecodev\Felix\Model\File |
|
20
|
|
|
{ |
|
21
|
|
|
use \Ecodev\Felix\Model\Traits\File; |
|
22
|
|
|
|
|
23
|
3 |
|
protected function getBasePath(): string |
|
24
|
|
|
{ |
|
25
|
3 |
|
return 'data/accounting/'; |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @var null|ExpenseClaim |
|
30
|
|
|
* |
|
31
|
|
|
* @ORM\ManyToOne(targetEntity="ExpenseClaim", inversedBy="accountingDocuments") |
|
32
|
|
|
* @ORM\JoinColumns({ |
|
33
|
|
|
* @ORM\JoinColumn(nullable=true, onDelete="CASCADE") |
|
34
|
|
|
* }) |
|
35
|
|
|
*/ |
|
36
|
|
|
private $expenseClaim; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @var null|Transaction |
|
40
|
|
|
* |
|
41
|
|
|
* @ORM\ManyToOne(targetEntity="Transaction", inversedBy="accountingDocuments") |
|
42
|
|
|
* @ORM\JoinColumns({ |
|
43
|
|
|
* @ORM\JoinColumn(nullable=true, onDelete="CASCADE") |
|
44
|
|
|
* }) |
|
45
|
|
|
*/ |
|
46
|
|
|
private $transaction; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @param null|ExpenseClaim $expenseClaim |
|
50
|
|
|
*/ |
|
51
|
7 |
|
public function setExpenseClaim(?ExpenseClaim $expenseClaim): void |
|
52
|
|
|
{ |
|
53
|
7 |
|
if ($this->expenseClaim) { |
|
54
|
1 |
|
$this->expenseClaim->accountingDocumentRemoved($this); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
7 |
|
$this->expenseClaim = $expenseClaim; |
|
58
|
|
|
|
|
59
|
7 |
|
if ($this->expenseClaim) { |
|
60
|
7 |
|
$expenseClaim->accountingDocumentAdded($this); |
|
|
|
|
|
|
61
|
|
|
} |
|
62
|
7 |
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @return null|ExpenseClaim |
|
66
|
|
|
*/ |
|
67
|
3 |
|
public function getExpenseClaim(): ?ExpenseClaim |
|
68
|
|
|
{ |
|
69
|
3 |
|
return $this->expenseClaim; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @param null|Transaction $transaction |
|
74
|
|
|
*/ |
|
75
|
1 |
|
public function setTransaction(?Transaction $transaction): void |
|
76
|
|
|
{ |
|
77
|
1 |
|
if ($this->transaction) { |
|
78
|
1 |
|
$this->transaction->accountingDocumentRemoved($this); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
1 |
|
$this->transaction = $transaction; |
|
82
|
|
|
|
|
83
|
1 |
|
if ($this->transaction) { |
|
84
|
1 |
|
$transaction->accountingDocumentAdded($this); |
|
|
|
|
|
|
85
|
|
|
} |
|
86
|
1 |
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @return null|Transaction |
|
90
|
|
|
*/ |
|
91
|
|
|
public function getTransaction(): ?Transaction |
|
92
|
|
|
{ |
|
93
|
|
|
return $this->transaction; |
|
94
|
|
|
} |
|
95
|
|
|
} |
|
96
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.