[person] Add a PersonRenderInterface

This commit is contained in:
nobohan 2022-02-15 17:48:54 +01:00
parent f2221565c5
commit 3aa12d2e8c
2 changed files with 35 additions and 1 deletions

View File

@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Templating\Entity;
use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender; use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper; use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Templating\Entity\PersonRenderInterface;
use Symfony\Component\Templating\EngineInterface; use Symfony\Component\Templating\EngineInterface;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
@ -22,7 +23,7 @@ use function array_key_exists;
/** /**
* Render a Person. * Render a Person.
*/ */
class PersonRender extends AbstractChillEntityRender class PersonRender extends AbstractChillEntityRender implements PersonRenderInterface
{ {
private ConfigPersonAltNamesHelper $configAltNamesHelper; private ConfigPersonAltNamesHelper $configAltNamesHelper;

View File

@ -0,0 +1,33 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Templating\Entity;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\PersonBundle\Entity\Person;
/**
* Render a Person.
*/
interface PersonRenderInterface extends ChillEntityRenderInterface
{
/**
* @param Person $person
*/
public function renderBox($person, array $options): string;
/**
* @param Person $person
*/
public function renderString($person, array $options): string;
public function supports($entity, array $options): bool;
}