| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function postRemoveEntity(LifecycleEventArgs $eventArgs) |
||
| 35 | { |
||
| 36 | $file = $eventArgs->getDocument(); |
||
| 37 | if (!$file instanceof Attachment) { |
||
| 38 | return; |
||
| 39 | } |
||
| 40 | |||
| 41 | $fileId = new \MongoId($file->id); |
||
|
|
|||
| 42 | $dm = $eventArgs->getDocumentManager(); |
||
| 43 | $dm->createQueryBuilder('Cv\Entity\Cv') |
||
| 44 | ->update()->multiple(true) |
||
| 45 | ->field('attachments')->equals($fileId)->pull($fileId) |
||
| 46 | ->getQuery()->execute(); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.