| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function tagImage(Image $image, bool $overwriteExisting = false): bool |
||
| 20 | { |
||
| 21 | if ($overwriteExisting === false && $image->getAutoTagsCount() > 0) { |
||
| 22 | return false; |
||
| 23 | } |
||
| 24 | |||
| 25 | $image->setAutoTags(['dummy', 'image', 'tagging', 'service']); |
||
| 26 | $this->entityManager->persist($image); |
||
| 27 | $this->entityManager->flush(); // Calling the API's a lot more overhead; we might as well flush on every image. |
||
| 28 | return true; |
||
| 29 | } |
||
| 31 |