mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
Add delete functionality in admin for news item
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Templating\Entity;
|
||||
|
||||
use Chill\MainBundle\Entity\NewsItem;
|
||||
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
|
||||
/**
|
||||
* @implements ChillEntityRenderInterface<NewsItem>
|
||||
*/
|
||||
final readonly class NewsItemRender implements ChillEntityRenderInterface
|
||||
{
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine) {}
|
||||
|
||||
public function renderBox($entity, array $options): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function renderString($entity, array $options): string
|
||||
{
|
||||
return $entity->getTitle();
|
||||
}
|
||||
|
||||
public function supports($newsItem, array $options): bool
|
||||
{
|
||||
return $newsItem instanceof NewsItem;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user