for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace A2lix\AutoFormBundle\Tests\Fixtures\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Product
{
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
protected $id;
* @ORM\Column(nullable=true)
protected $title;
* @ORM\Column(type="text", nullable=true)
protected $description;
protected $url;
* @ORM\OneToMany(targetEntity="Media", mappedBy="product", cascade={"all"}, orphanRemoval=true)
protected $medias;
public function __construct()
$this->medias = new \Doctrine\Common\Collections\ArrayCollection();
}
public function getId()
return $this->id;
public function getTitle()
return $this->title;
public function setTitle($title)
$this->title = $title;
return $this;
public function getDescription()
return $this->description;
public function setDescription($description)
$this->description = $description;
public function getUrl()
return $this->url;
public function setUrl($url)
$this->url = $url;
public function getMedias()
return $this->medias;
public function addMedia(Media $media)
if (!$this->medias->contains($media)) {
$media->setProduct($this);
$this->medias->add($media);
public function removeMedia(Media $media)
if ($this->medias->contains($media)) {
$this->medias->removeElement($media);