Last active
December 28, 2015 17:29
-
-
Save harentius/7536703 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Harentius\SiteBundle\Entity; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* Products | |
* | |
* @ORM\Table(name="products") | |
* @ORM\Entity | |
*/ | |
class Products | |
{ | |
/** | |
* @var string | |
* | |
* @ORM\Column(name="name", type="string", length=1000, nullable=false) | |
*/ | |
private $name; | |
/** | |
* @var string | |
* | |
* @ORM\Column(name="comment", type="text", nullable=false) | |
*/ | |
private $comment; | |
/** | |
* @var float | |
* | |
* @ORM\Column(name="price", type="float", nullable=false) | |
*/ | |
private $price; | |
/** | |
* @var integer | |
* | |
* @ORM\Column(name="id", type="integer") | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="IDENTITY") | |
*/ | |
private $id; | |
/** | |
* @var \Harentius\SiteBundle\Entity\Category | |
* | |
* @ORM\ManyToOne(targetEntity="Harentius\SiteBundle\Entity\Category") | |
* @ORM\JoinColumns({ | |
* @ORM\JoinColumn(name="id_category", referencedColumnName="id") | |
* }) | |
*/ | |
private $category; | |
/** | |
* @var \Harentius\SiteBundle\Entity\Properties | |
* | |
* @ORM\Column(name="id_property", type="integer") | |
* @ORM\ManyToMany(targetEntity="Harentius\SiteBundle\Entity\Properties", mappedBy="products") | |
* @ORM\JoinTable(name="products") | |
*/ | |
private $properties; | |
/** | |
* | |
*/ | |
public function __construct() | |
{ | |
$this->properties = new ArrayCollection(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Harentius\SiteBundle\Entity; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* Properties | |
* | |
* @ORM\Table(name="properties") | |
* @ORM\Entity | |
*/ | |
class Properties | |
{ | |
/** | |
* @var string | |
* | |
* @ORM\Column(name="name", type="string", length=1000, nullable=false) | |
*/ | |
private $name; | |
/** | |
* @var string | |
* | |
* @ORM\Column(name="comment", type="text", nullable=false) | |
*/ | |
private $comment; | |
/** | |
* @var integer | |
* | |
* @ORM\Column(name="id", type="integer") | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="IDENTITY") | |
*/ | |
private $id; | |
/** | |
* @var \Harentius\SiteBundle\Entity\Products | |
* | |
* @ORM\Column(name="id_product", type="integer") | |
* @ORM\ManyToMany(targetEntity="Harentius\SiteBundle\Entity\Products", inversedBy="properties") | |
*/ | |
private $products; | |
/** | |
* | |
*/ | |
public function __construct() | |
{ | |
$this->products = new ArrayCollection(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment