public function createPost($title) { $post = new SimpleBlogPost($title); $wroteRel = new SimpleBlogWrote($this, $post); $this->posts->add($wroteRel); $post->setPublication($wroteRel); }
private function init() { $this->clearDb(); $user = new SimpleBlogUser('john'); $user->createPost('New Blog Post'); $this->em->persist($user); $this->em->flush(); $this->em->clear(); }