create news item entity and the admin for it

This commit is contained in:
2023-11-01 16:25:14 +01:00
parent 87615d179e
commit 7bdb5bfce6
11 changed files with 306 additions and 3 deletions

View File

@@ -0,0 +1,59 @@
<?php
namespace Chill\MainBundle\Repository;
use Chill\MainBundle\Entity\NewsItem;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ObjectRepository;
class NewsItemRepository implements ObjectRepository
{
private readonly EntityRepository $repository;
public function __construct(EntityManagerInterface $entityManager)
{
$this->repository = $entityManager->getRepository(NewsItem::class);
}
/**
* @inheritDoc
*/
public function find($id)
{
$this->repository->find($id);
}
/**
* @inheritDoc
*/
public function findAll()
{
return $this->repository->findAll();
}
/**
* @inheritDoc
*/
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null)
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
/**
* @inheritDoc
*/
public function findOneBy(array $criteria)
{
return $this->repository->findOneBy($criteria);
}
/**
* @inheritDoc
*/
public function getClassName()
{
return NewsItem::class;
}
}