@@ 75-86 (lines=12) @@ | ||
72 | /** |
|
73 | * @ODM\PrePersist |
|
74 | */ |
|
75 | public function prePersist() |
|
76 | { |
|
77 | $repository = $this->getRepository(); |
|
78 | ||
79 | if (method_exists($repository, 'preSave')) { |
|
80 | $repository->preSave($this); |
|
81 | } |
|
82 | ||
83 | if (method_exists($repository, 'preSave')) { |
|
84 | $repository->validate($this); |
|
85 | } |
|
86 | } |
|
87 | ||
88 | /** |
|
89 | * @ODM\PostPersist |
|
@@ 107-118 (lines=12) @@ | ||
104 | /** |
|
105 | * @ODM\PreUpdate |
|
106 | */ |
|
107 | public function preUpdate() |
|
108 | { |
|
109 | $repository = $this->getRepository(); |
|
110 | ||
111 | if (method_exists($repository, 'preSave')) { |
|
112 | $repository->preSave($this); |
|
113 | } |
|
114 | ||
115 | if (method_exists($repository, 'preSave')) { |
|
116 | $repository->validate($this); |
|
117 | } |
|
118 | } |
|
119 | ||
120 | /** |
|
121 | * @ODM\PostUpdate |