| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 59 | public function send() |
||
| 60 | { |
||
| 61 | $article = new Article(); |
||
| 62 | $article->setAuthor($this->author); |
||
| 63 | $article->setStatus(self::STATUS_PUBLISHED); |
||
| 64 | $article->setPublishedAt(new \Datetime()); |
||
| 65 | |||
| 66 | foreach ($this->titles as $lang => $value) { |
||
| 67 | $article->translate($lang, false)->setTitle($value); |
||
| 68 | } |
||
| 69 | foreach ($this->texts as $lang => $value) { |
||
| 70 | $article->translate($lang, false)->setText($value); |
||
| 71 | } |
||
| 72 | $article->mergeNewTranslations(); |
||
| 73 | |||
| 74 | $this->em->persist($article); |
||
| 75 | $this->em->flush(); |
||
| 76 | } |
||
| 78 |