Created
December 2, 2011 10:18
-
-
Save haswalt/1422693 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 \Acme\Bundle\ExampleBundle\Entity; | |
use \Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="product_variants", indexes={ | |
* @ORM\index(name="variant_name_idx", columns={"name"}) | |
* }) | |
*/ | |
class Variant | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
protected $id; | |
/** | |
* @ORM\Column(type="string", length=255, unique=true) | |
*/ | |
protected $name; | |
/** | |
* @ORM\Column(type="string", length=255) | |
*/ | |
protected $nameCanonical; | |
/** | |
* @ORM\Column(type="string", length=255, unique=true) | |
*/ | |
protected $slug; | |
/** | |
* @ORM\Column(type="datetime") | |
*/ | |
protected $createdAt; | |
/** | |
* @ORM\Column(type="datetime") | |
*/ | |
protected $updatedAt; | |
/** | |
* @ORM\ManyToMany(targetEntity="Attribute") | |
* @ORM\JoinTable(name="product_variant_attributes", joinColumns={ | |
* @ORM\JoinColumn(name="variant_id, referencedColumnName="id") | |
* }, inverseJoinColumns={ | |
* @ORM\JoinColumn(name="attribute_id", referencedColumnName="id") | |
* }) | |
*/ | |
protected $attributes; | |
public function __construct() | |
{ | |
$this->createdAt = new \DateTime(); | |
$this->updatedAt = new \DateTime(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment