vendor/roothirsch/shop-bundle/Entity/Order/OrderAttribute.php line 24

Open in your IDE?
  1. <?php
  2. namespace Roothirsch\ShopBundle\Entity\Order;
  3. use Roothirsch\CoreBundle\Behaviors\Attributable\AttributeInterface;
  4. use Roothirsch\CoreBundle\Behaviors\Attributable\AttributeOption\AttributeOptionAwareTrait;
  5. use Roothirsch\CoreBundle\Behaviors\Attributable\AttributeValue\AttributeValueAwareTrait;
  6. use Roothirsch\CoreBundle\Behaviors\Attributable\MappedSuperclass\AbstractAttribute;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. use Roothirsch\ShopBundle\Entity\Order\OrderAttributeOption;
  12. use Roothirsch\ShopBundle\Entity\Order\OrderAttributeValue;
  13. use ApiPlatform\Core\Annotation\ApiResource;
  14. use Roothirsch\ShopBundle\Repository\OrderAttributeRepository;
  15. /**
  16. * @ApiResource( shortName="Shop/OrderAttribute")
  17. * @ORM\Entity(repositoryClass=OrderAttributeRepository::class)
  18. * @ORM\Table(name="shop_order_attribute")
  19. */
  20. class OrderAttribute extends AbstractAttribute
  21. {
  22. use AttributeOptionAwareTrait;
  23. use AttributeValueAwareTrait;
  24. /**
  25. * @ORM\OneToMany(targetEntity=OrderAttributeValue::class, mappedBy="attribute", orphanRemoval=true)
  26. */
  27. private $attributeValues;
  28. /**
  29. * @ORM\OneToMany(targetEntity=OrderAttributeOption::class, mappedBy="attribute", orphanRemoval=true, cascade={"persist"})
  30. * @ORM\OrderBy({"position" = "ASC"})
  31. */
  32. private $attributeOptions;
  33. }