<?php
namespace Roothirsch\ShopBundle\Entity\Estimate;
use Roothirsch\CoreBundle\Behaviors\Attributable\AttributeInterface;
use Roothirsch\CoreBundle\Behaviors\Attributable\AttributeOption\AttributeOptionAwareTrait;
use Roothirsch\CoreBundle\Behaviors\Attributable\AttributeValue\AttributeValueAwareTrait;
use Roothirsch\CoreBundle\Behaviors\Attributable\MappedSuperclass\AbstractAttribute;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Roothirsch\ShopBundle\Entity\Estimate\EstimateAttributeOption;
use Roothirsch\ShopBundle\Entity\Estimate\EstimateAttributeValue;
use ApiPlatform\Core\Annotation\ApiResource;
use Roothirsch\ShopBundle\Repository\EstimateAttributeRepository;
/**
* @ApiResource( shortName="Shop/EstimateAttribute")
* @ORM\Entity(repositoryClass=EstimateAttributeRepository::class)
* @ORM\Table(name="shop_estimate_attribute")
*/
class EstimateAttribute extends AbstractAttribute
{
use AttributeOptionAwareTrait;
use AttributeValueAwareTrait;
/**
* @ORM\OneToMany(targetEntity=EstimateAttributeValue::class, mappedBy="attribute", orphanRemoval=true)
*/
private $attributeValues;
/**
* @ORM\OneToMany(targetEntity=EstimateAttributeOption::class, mappedBy="attribute", orphanRemoval=true, cascade={"persist"})
* @ORM\OrderBy({"position" = "ASC"})
*/
private $attributeOptions;
}