mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-12 07:36:34 +03:00
Update MsgPHP user + EAV bundle to v0.2
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use MsgPhp\Eav\Entity\{Attribute, AttributeValue};
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return function (ContainerConfigurator $container) {
|
||||
$container->extension('msgphp_eav', [
|
||||
'class_mapping' => [
|
||||
Attribute::class => \App\Entity\Eav\Attribute::class,
|
||||
AttributeValue::class => \App\Entity\Eav\AttributeValue::class,
|
||||
],
|
||||
]);
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"bundles": {
|
||||
"MsgPhp\\EavBundle\\MsgPhpEavBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Eav;
|
||||
|
||||
use MsgPhp\Eav\AttributeIdInterface;
|
||||
use MsgPhp\Eav\Entity\Attribute as BaseAttribute;
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
class Attribute extends BaseAttribute
|
||||
{
|
||||
private $id;
|
||||
|
||||
public function __construct(AttributeIdInterface $id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function getId(): AttributeIdInterface
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Eav;
|
||||
|
||||
use MsgPhp\Eav\AttributeValueIdInterface;
|
||||
use MsgPhp\Eav\Entity\AttributeValue as BaseAttributeValue;
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
class AttributeValue extends BaseAttributeValue
|
||||
{
|
||||
private $id;
|
||||
|
||||
public function __construct(AttributeValueIdInterface $id, Attribute $attribute, $value)
|
||||
{
|
||||
parent::__construct($attribute, $value);
|
||||
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function getId(): AttributeValueIdInterface
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user