Created
February 8, 2018 18:29
-
-
Save vojtabiberle/ec9df148635a043efff4746f4f1708d9 to your computer and use it in GitHub Desktop.
Fixtures issue
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 Eshop\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity(repositoryClass="Eshop\Repository\ProductTagRepository") | |
* @ORM\Table(name="product_tag") | |
**/ | |
class ProductTag | |
{ | |
/** | |
* @var int | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue | |
**/ | |
protected $id; | |
/** | |
* @var Tag $tag | |
* @ORM\ManyToOne(targetEntity="Tag", cascade={"persist"}) | |
* @ORM\JoinColumn(name="tag_id", referencedColumnName="id", nullable=false) | |
*/ | |
protected $tag; | |
/** | |
* @var Product $product | |
* @ORM\ManyToOne(targetEntity="Product", cascade={"persist"}) | |
* @ORM\JoinColumn(name="product_id", referencedColumnName="id", nullable=false) | |
*/ | |
protected $product; | |
/** | |
* @return int | |
*/ | |
public function getId(): int | |
{ | |
return $this->id; | |
} | |
/** | |
* @param int $id | |
*/ | |
public function setId(int $id) | |
{ | |
$this->id = $id; | |
} | |
/** | |
* @return Tag | |
*/ | |
public function getTag(): Tag | |
{ | |
return $this->tag; | |
} | |
/** | |
* @param Tag $tag | |
*/ | |
public function setTag(Tag $tag) | |
{ | |
$this->tag = $tag; | |
} | |
/** | |
* @return Product | |
*/ | |
public function getProduct(): Product | |
{ | |
return $this->product; | |
} | |
/** | |
* @param Product $product | |
*/ | |
public function setProduct(Product $product) | |
{ | |
$this->product = $product; | |
} | |
} |
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 Eshop\Entity; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity(repositoryClass="Eshop\Repository\TagRepository") | |
* @ORM\Table(name="tag") | |
**/ | |
class Tag | |
{ | |
/** | |
* @var int | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue | |
**/ | |
private $id; | |
/** | |
* @var string $name | |
* @ORM\Column(name="name", type="string", nullable=false) | |
*/ | |
private $name; | |
/** | |
* @var string $description | |
* @ORM\Column(name="description", type="string", nullable=false) | |
*/ | |
private $description; | |
/** | |
* @var string $color | |
* @ORM\Column(name="color", type="string", nullable=false) | |
*/ | |
private $color; | |
/** | |
* @var ProductTag[]|Collection $productTags | |
* @ORM\OneToMany(targetEntity="ProductTag", mappedBy="tag", fetch="EXTRA_LAZY") | |
*/ | |
private $productTags; | |
/** | |
* @var CategoryTagVisibility[]|Collection $categoryTagsVisibility | |
* @ORM\OneToMany(targetEntity="CategoryTagVisibility", mappedBy="tag", fetch="EXTRA_LAZY") | |
*/ | |
private $categoryTagsVisibility; | |
/** | |
* @var CategoryMetaTag[]|Collection $categoryMetaTags | |
* @ORM\OneToMany(targetEntity="CategoryMetaTag", mappedBy="tag", fetch="EXTRA_LAZY") | |
*/ | |
private $categoryMetaTags; | |
public function __construct() | |
{ | |
$this->productTags = new ArrayCollection(); | |
$this->categoryTagsVisibility = new ArrayCollection(); | |
$this->categoryMetaTags = new ArrayCollection(); | |
} | |
/** | |
* @return int | |
*/ | |
public function getId(): int | |
{ | |
return $this->id; | |
} | |
/** | |
* @param int $id | |
*/ | |
public function setId(int $id) | |
{ | |
$this->id = $id; | |
} | |
/** | |
* @return string | |
*/ | |
public function getName(): string | |
{ | |
return $this->name; | |
} | |
/** | |
* @param string $name | |
*/ | |
public function setName(string $name) | |
{ | |
$this->name = $name; | |
} | |
/** | |
* @return string | |
*/ | |
public function getDescription(): string | |
{ | |
return $this->description; | |
} | |
/** | |
* @param string $description | |
*/ | |
public function setDescription(string $description) | |
{ | |
$this->description = $description; | |
} | |
/** | |
* @return string | |
*/ | |
public function getColor(): string | |
{ | |
return $this->color; | |
} | |
/** | |
* @param string $color | |
*/ | |
public function setColor(string $color) | |
{ | |
$this->color = $color; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment