|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Application\Model; |
|
6
|
|
|
|
|
7
|
|
|
use Application\Repository\AccountingDocumentRepository; |
|
8
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* A document attesting an expense claim. |
|
12
|
|
|
*/ |
|
13
|
|
|
#[ORM\UniqueConstraint(name: 'unique_name', columns: ['filename'])] |
|
14
|
|
|
#[ORM\HasLifecycleCallbacks] |
|
15
|
|
|
#[ORM\Entity(AccountingDocumentRepository::class)] |
|
16
|
|
|
class AccountingDocument extends AbstractModel implements \Ecodev\Felix\Model\File |
|
17
|
|
|
{ |
|
18
|
|
|
use \Ecodev\Felix\Model\Traits\File; |
|
19
|
|
|
|
|
20
|
3 |
|
protected function getBasePath(): string |
|
21
|
|
|
{ |
|
22
|
3 |
|
return 'data/accounting/'; |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
#[ORM\JoinColumn(onDelete: 'CASCADE')] |
|
26
|
|
|
#[ORM\ManyToOne(targetEntity: ExpenseClaim::class, inversedBy: 'accountingDocuments')] |
|
27
|
|
|
private ?ExpenseClaim $expenseClaim = null; |
|
28
|
|
|
|
|
29
|
|
|
#[ORM\JoinColumn(onDelete: 'CASCADE')] |
|
30
|
|
|
#[ORM\ManyToOne(targetEntity: Transaction::class, inversedBy: 'accountingDocuments')] |
|
31
|
|
|
private ?Transaction $transaction = null; |
|
32
|
|
|
|
|
33
|
7 |
|
public function setExpenseClaim(?ExpenseClaim $expenseClaim): void |
|
34
|
|
|
{ |
|
35
|
7 |
|
if ($this->expenseClaim) { |
|
36
|
1 |
|
$this->expenseClaim->accountingDocumentRemoved($this); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
7 |
|
$this->expenseClaim = $expenseClaim; |
|
40
|
|
|
|
|
41
|
7 |
|
if ($this->expenseClaim) { |
|
42
|
7 |
|
$expenseClaim->accountingDocumentAdded($this); |
|
|
|
|
|
|
43
|
|
|
} |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
3 |
|
public function getExpenseClaim(): ?ExpenseClaim |
|
47
|
|
|
{ |
|
48
|
3 |
|
return $this->expenseClaim; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
1 |
|
public function setTransaction(?Transaction $transaction): void |
|
52
|
|
|
{ |
|
53
|
1 |
|
if ($this->transaction) { |
|
54
|
1 |
|
$this->transaction->accountingDocumentRemoved($this); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
1 |
|
$this->transaction = $transaction; |
|
58
|
|
|
|
|
59
|
1 |
|
if ($this->transaction) { |
|
60
|
1 |
|
$transaction->accountingDocumentAdded($this); |
|
|
|
|
|
|
61
|
|
|
} |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function getTransaction(): ?Transaction |
|
65
|
|
|
{ |
|
66
|
|
|
return $this->transaction; |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|
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.