declare(strict_types=1);
namespace App\Entity\Product;
use Abenmada\BrokenLinkHandlerPlugin\Model\SlugHistory\ProductSlugHistoryTrait;
use Abenmada\BrokenLinkHandlerPlugin\Validator\SlugExistsInOtherProductSlugHistories;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Product as BaseProduct;
use Symfony\Component\Validator\Mapping\ClassMetadata;
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product")
*/
#[ORM\Entity]
#[ORM\Table(name: 'sylius_product')]
class Product extends BaseProduct
{
use ProductSlugHistoryTrait;
public function __construct()
{
$this->productSlugHistories = new ArrayCollection();
parent::__construct();
}
public static function loadValidatorMetadata(ClassMetadata $metadata): void
{
$metadata->addConstraint(new SlugExistsInOtherProductSlugHistories([
'groups' => 'sylius',
]));
}
}
declare(strict_types=1);
namespace App\Entity\Taxonomy;
use Abenmada\BrokenLinkHandlerPlugin\Model\SlugHistory\TaxonSlugHistoryTrait;
use Abenmada\BrokenLinkHandlerPlugin\Validator\SlugExistsInOtherTaxonSlugHistories;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Taxon as BaseTaxon;
use Symfony\Component\Validator\Mapping\ClassMetadata;
/**
* @ORM\Entity
* @ORM\Table(name="sylius_taxon")
*/
#[ORM\Entity]
#[ORM\Table(name: 'sylius_taxon')]
class Taxon extends BaseTaxon
{
use TaxonSlugHistoryTrait;
public function __construct()
{
$this->taxonSlugHistories = new ArrayCollection();
parent::__construct();
}
public static function loadValidatorMetadata(ClassMetadata $metadata): void
{
$metadata->addConstraint(new SlugExistsInOtherTaxonSlugHistories([
'groups' => 'sylius',
]));
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.