mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-23 23:25:00 +00:00
Add attachments to workflow
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\CalendarBundle\Repository;
|
||||
|
||||
use Chill\CalendarBundle\Entity\CalendarDoc;
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
@@ -49,4 +50,21 @@ class CalendarDocRepository implements ObjectRepository, CalendarDocRepositoryIn
|
||||
{
|
||||
return CalendarDoc::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param StoredObject|int $storedObject the StoredObject instance, or the id of the stored object
|
||||
*/
|
||||
public function findOneByStoredObject(StoredObject|int $storedObject): ?CalendarDoc
|
||||
{
|
||||
$storedObjectId = $storedObject instanceof StoredObject ? $storedObject->getId() : $storedObject;
|
||||
|
||||
$qb = $this->repository->createQueryBuilder('c');
|
||||
$qb->where(
|
||||
$qb->expr()->eq(':storedObject', 'c.storedObject')
|
||||
);
|
||||
|
||||
$qb->setParameter('storedObject', $storedObjectId);
|
||||
|
||||
return $qb->getQuery()->getOneOrNullResult();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user