PHP code example of tavy315 / sylius-labels-plugin
1. Go to this page and download the library: Download tavy315/sylius-labels-plugin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// src/Entity/Product.php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Product as BaseProduct;
use Tavy315\SyliusLabelsPlugin\Model\LabelsAwareTrait;
use Tavy315\SyliusLabelsPlugin\Model\ProductInterface;
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product")
*/
class Product extends BaseProduct implements ProductInterface
{
use LabelsAwareTrait {
LabelsAwareTrait::__construct as private __labelsTraitConstruct;
}
public function __construct()
{
$this->__labelsTraitConstruct();
parent::__construct();
}
}
// src/Model/Product.php
namespace App\Model;
use Sylius\Component\Core\Model\Product as BaseProduct;
use Tavy315\SyliusLabelsPlugin\Model\LabelsAwareTrait;
use Tavy315\SyliusLabelsPlugin\Model\ProductInterface;
class Product extends BaseProduct implements ProductInterface
{
use LabelsAwareTrait {
LabelsAwareTrait::__construct as private __labelsTraitConstruct;
}
public function __construct()
{
$this->__labelsTraitConstruct();
parent::__construct();
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.