mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
In between commit solving tests for meta and template management
This commit is contained in:
@@ -3,12 +3,30 @@
|
||||
namespace App\Domain\SourceManagement;
|
||||
|
||||
use App\Domain\EntityManagement\EntityMetaInformation;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
final class SourceMetaInformation extends EntityMetaInformation implements SourceMetaInformationInterface
|
||||
{
|
||||
const UNPURE = 'source';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Domain\EntityManagement\EntityMetaInformation::__construct()
|
||||
*
|
||||
* @param $entity AbstractSource
|
||||
*/
|
||||
public function __construct(\App\Entity\EntityInterface $entity)
|
||||
{
|
||||
if (!$entity instanceof AbstractSource) {
|
||||
throw new \TypeError('Entity has to be an instance of '.AbstractSource::class);
|
||||
}
|
||||
parent::__construct($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
@@ -17,6 +35,6 @@ final class SourceMetaInformation extends EntityMetaInformation implements Sourc
|
||||
protected function setPureName(): void
|
||||
{
|
||||
parent::setPureName();
|
||||
$this->pureName = str_replace('Source', '', $this->pureName);
|
||||
$this->pureName = substr($this->pureName, 0, -strlen(self::UNPURE));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user