1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Application\Model; |
6
|
|
|
|
7
|
|
|
use Doctrine\ORM\Mapping as ORM; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* A document attesting an expense claim |
11
|
|
|
* |
12
|
|
|
* @ORM\HasLifecycleCallbacks |
13
|
|
|
* @ORM\Entity(repositoryClass="Application\Repository\AccountingDocumentRepository") |
14
|
|
|
*/ |
15
|
|
|
class AccountingDocument extends AbstractFile |
16
|
|
|
{ |
17
|
3 |
|
protected function getBasePath(): string |
18
|
|
|
{ |
19
|
3 |
|
return 'data/accounting/'; |
20
|
|
|
} |
21
|
|
|
|
22
|
1 |
|
protected function getAcceptedMimeTypes(): array |
23
|
|
|
{ |
24
|
|
|
return [ |
25
|
1 |
|
'image/bmp', |
26
|
|
|
'image/gif', |
27
|
|
|
'image/jpeg', |
28
|
|
|
'image/pjpeg', |
29
|
|
|
'image/png', |
30
|
|
|
'image/webp', |
31
|
|
|
'application/pdf', |
32
|
|
|
'application/x-pdf', |
33
|
|
|
]; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var ExpenseClaim |
38
|
|
|
* |
39
|
|
|
* @ORM\ManyToOne(targetEntity="ExpenseClaim", inversedBy="accountingDocuments") |
40
|
|
|
* @ORM\JoinColumns({ |
41
|
|
|
* @ORM\JoinColumn(nullable=true, onDelete="CASCADE") |
42
|
|
|
* }) |
43
|
|
|
*/ |
44
|
|
|
private $expenseClaim; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var Transaction |
48
|
|
|
* |
49
|
|
|
* @ORM\ManyToOne(targetEntity="Transaction", inversedBy="accountingDocuments") |
50
|
|
|
* @ORM\JoinColumns({ |
51
|
|
|
* @ORM\JoinColumn(nullable=true, onDelete="CASCADE") |
52
|
|
|
* }) |
53
|
|
|
*/ |
54
|
|
|
private $transaction; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param null|ExpenseClaim $expenseClaim |
58
|
|
|
*/ |
59
|
7 |
|
public function setExpenseClaim(?ExpenseClaim $expenseClaim): void |
60
|
|
|
{ |
61
|
7 |
|
if ($this->expenseClaim && $expenseClaim !== $this->expenseClaim) { |
62
|
1 |
|
$this->expenseClaim->accountingDocumentRemoved($this); |
63
|
|
|
} |
64
|
|
|
|
65
|
7 |
|
$this->expenseClaim = $expenseClaim; |
66
|
7 |
|
$expenseClaim->accountingDocumentAdded($this); |
|
|
|
|
67
|
7 |
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @return null|ExpenseClaim |
71
|
|
|
*/ |
72
|
4 |
|
public function getExpenseClaim(): ?ExpenseClaim |
73
|
|
|
{ |
74
|
4 |
|
return $this->expenseClaim; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @param null|Transaction $transaction |
79
|
|
|
*/ |
80
|
|
|
public function setTransaction(?Transaction $transaction): void |
81
|
|
|
{ |
82
|
|
|
if ($this->transaction && $transaction !== $this->transaction) { |
83
|
|
|
$this->transaction->accountingDocumentRemoved($this); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
$this->transaction = $transaction; |
87
|
|
|
$transaction->accountingDocumentAdded($this); |
|
|
|
|
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return null|Transaction |
92
|
|
|
*/ |
93
|
|
|
public function getTransaction(): ?Transaction |
94
|
|
|
{ |
95
|
|
|
return $this->transaction; |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|
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.