Files
DesignPatternsPHP/More/EAV/Value.php
Dominik Liebler 4678b5d86f PHP8
2021-04-12 14:04:45 +02:00

17 lines
368 B
PHP

<?php declare(strict_types=1);
namespace DesignPatterns\More\EAV;
class Value implements \Stringable
{
public function __construct(private Attribute $attribute, private string $name)
{
$attribute->addValue($this);
}
public function __toString(): string
{
return sprintf('%s: %s', (string) $this->attribute, $this->name);
}
}