public function __construct(Post $entity) { $this->name = $entity->getName(); $this->image = $entity->getImage(); $this->intro = $entity->getIntro(); $this->content = $entity->getContent(); $this->status = $entity->getStatus(); $this->tags = $entity->getTags(); }
/** * Set post * * @param \Desarrolla2\Bundle\BlogBundle\Entity\Post $post * @return PostHistory */ public function setPost(\Desarrolla2\Bundle\BlogBundle\Entity\Post $post = null) { $this->post = $post; $this->setName($post->getName()); $this->setIntro($post->getIntro()); $this->setContent($post->getContent()); return $this; }