In between commit solving tests for meta and template management

This commit is contained in:
Kevin Frantz
2019-01-06 13:13:24 +01:00
parent 6352e82ce1
commit 72d0a6ba95
11 changed files with 289 additions and 108 deletions

View File

@@ -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));
}
}