Skip to content

Instantly share code, notes, and snippets.

@harentius
Last active December 28, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harentius/7536703 to your computer and use it in GitHub Desktop.
Save harentius/7536703 to your computer and use it in GitHub Desktop.
<?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();
}
<?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