feat: Themes (#257)
* feat: add trait to unify get by id or slug logic * feat: add Theme resource * fix: categories and themes * feat: update api docs for projects to themes relationship * feat: update doctrine relationship of projects to themes * feat: add v3 categories to v4 themes pumping during projects pumping
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Repository\Project;
|
||||
|
||||
use App\Entity\Accounting\Accounting;
|
||||
use App\Entity\Project\Project;
|
||||
use App\Repository\FindByIdOrSlugTrait;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
@@ -17,6 +18,8 @@ use Doctrine\Persistence\ManagerRegistry;
|
||||
*/
|
||||
class ProjectRepository extends ServiceEntityRepository
|
||||
{
|
||||
use FindByIdOrSlugTrait;
|
||||
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Project::class);
|
||||
@@ -31,15 +34,6 @@ class ProjectRepository extends ServiceEntityRepository
|
||||
->getOneOrNullResult();
|
||||
}
|
||||
|
||||
public function findOneByIdOrSlug(mixed $idOrSlug): ?Project
|
||||
{
|
||||
if (\is_numeric($idOrSlug)) {
|
||||
return $this->find($idOrSlug);
|
||||
}
|
||||
|
||||
return $this->findOneBy(['slug' => $idOrSlug]);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Project[] Returns an array of Project objects
|
||||
// */
|
||||
|
||||
Reference in New Issue
Block a user