Example #1
0
 /**
  * Create a new article with a given title and content
  *
  * @param Article $article
  */
 public function create(Article $article)
 {
     // The created date can be set on PrePersist event
     // but this is an example for instructions that can be done while creating the Object
     $article->setCreatedDate(new \DateTime());
     $this->em->persist($article);
 }