Example #1
0
 /**
  * Создания статьи
  * @param $title
  * @param $text
  * @param $authors
  * @param $rating
  * @param $date
  * @return Article
  */
 private function createArticle($title, $text, $authors, $rating, $date)
 {
     $object = new Article();
     $object->setTitle($title);
     $object->setContent($text);
     $object->setRating($rating);
     $object->setDate(new \DateTime($date));
     $object->setAuthors($authors);
     $this->om->persist($object);
     return $object;
 }