remove privateCommentRender

This commit is contained in:
Julie Lenaerts 2022-05-02 16:29:47 +02:00
parent 1b6e84262b
commit 3122098447
2 changed files with 0 additions and 76 deletions

View File

@ -1,72 +0,0 @@
<?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\MainBundle\Templating\Entity;
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Templating\EngineInterface;
use function array_merge;
class PrivateCommentRender extends AbstractChillEntityRender
{
private EngineInterface $engine;
private Security $security;
public function __construct(
EngineInterface $engine,
Security $security
) {
$this->engine = $engine;
$this->sercurity = $security;
}
/**
* @param PrivateCommentEmbeddable $entity
*/
public function renderBox($entity, array $options): string
{
// default options
$options = array_merge([
'user' => [],
'disable_markdown' => false,
'limit_lines' => null,
'metadata' => true,
], $options);
return $this->engine
->render(
'@ChillMain/Entity/CommentEmbeddable.html.twig',
[
'opening_box' => $this->getDefaultOpeningBox('comment-embeddable'),
'closing_box' => $this->getDefaultClosingBox(),
'user' => $this->security->getUser() ?? null,
'comment' => $entity->getCommentForUser($this->security->getUser()),
'options' => $options,
]
);
}
/**
* @param PrivateCommentEmbeddable $entity
*/
public function renderString($entity, array $options): string
{
return $entity->getCommentForUser($this->security->getUser());
}
public function supports($entity, array $options): bool
{
return $entity instanceof PrivateCommentEmbeddable;
}
}

View File

@ -41,10 +41,6 @@ services:
tags:
- { name: 'chill.render_entity' }
Chill\MainBundle\Templating\Entity\PrivateCommentRender:
tags:
- { name: 'chill.render_entity' }
Chill\MainBundle\Templating\ChillMarkdownRenderExtension:
tags:
- { name: twig.extension }