mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-17 18:16:46 +03:00
update msgphp bundles to 0.10
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
use MsgPhp\Eav\Attribute;
|
||||
use MsgPhp\Eav\AttributeValue;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return function (ContainerConfigurator $container) {
|
||||
$container->extension('msgphp_eav', [
|
||||
'class_mapping' => [
|
||||
Attribute::class => \App\Entity\Attribute::class,
|
||||
AttributeValue::class => \App\Entity\AttributeValue::class,
|
||||
],
|
||||
]);
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"bundles": {
|
||||
"MsgPhp\\EavBundle\\MsgPhpEavBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use MsgPhp\Eav\Attribute as BaseAttribute;
|
||||
use MsgPhp\Eav\AttributeId;
|
||||
|
||||
/**
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class Attribute extends BaseAttribute
|
||||
{
|
||||
/** @ORM\Id() @ORM\GeneratedValue() @ORM\Column(type="msgphp_attribute_id", length=191) */
|
||||
private $id;
|
||||
|
||||
public function __construct(AttributeId $id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function getId(): AttributeId
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use MsgPhp\Eav\AttributeValue as BaseAttributeValue;
|
||||
use MsgPhp\Eav\AttributeValueId;
|
||||
|
||||
/**
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class AttributeValue extends BaseAttributeValue
|
||||
{
|
||||
/** @ORM\Id() @ORM\GeneratedValue() @ORM\Column(type="msgphp_attribute_value_id", length=191) */
|
||||
private $id;
|
||||
|
||||
public function __construct(AttributeValueId $id, Attribute $attribute, $value)
|
||||
{
|
||||
parent::__construct($attribute, $value);
|
||||
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function getId(): AttributeValueId
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user