mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix how to get task repository
This commit is contained in:
parent
31e1a40cb7
commit
43d12a9647
@ -148,10 +148,9 @@ class SingleTaskController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
public function showAction(Request $request, $id)
|
public function showAction(Request $request, $id)
|
||||||
{
|
{
|
||||||
/* @var $taskRepository SingleTaskRepository */
|
|
||||||
$taskRepository = $this->get('chill_task.single_task_repository');
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$task = $em->getRepository(SingleTask::class)->find($id);
|
||||||
$task = $taskRepository->find($id);
|
|
||||||
|
|
||||||
if (!is_null($task->getPerson() === !null)) {
|
if (!is_null($task->getPerson() === !null)) {
|
||||||
$personId = $task->getPerson()->getId();
|
$personId = $task->getPerson()->getId();
|
||||||
@ -203,10 +202,9 @@ class SingleTaskController extends AbstractController
|
|||||||
$id,
|
$id,
|
||||||
TranslatorInterface $translator
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
/* @var $taskRepository SingleTaskRepository */
|
|
||||||
$taskRepository = $this->get('chill_task.single_task_repository');
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$task = $em->getRepository(SingleTask::class)->find($id);
|
||||||
$task = $taskRepository->find($id);
|
|
||||||
|
|
||||||
if (!is_null($task->getPerson() === !null)) {
|
if (!is_null($task->getPerson() === !null)) {
|
||||||
$personId = $task->getPerson()->getId();
|
$personId = $task->getPerson()->getId();
|
||||||
@ -297,10 +295,9 @@ class SingleTaskController extends AbstractController
|
|||||||
$id,
|
$id,
|
||||||
TranslatorInterface $translator
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
/* @var $taskRepository SingleTaskRepository */
|
|
||||||
$taskRepository = $this->get('chill_task.single_task_repository');
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$task = $em->getRepository(SingleTask::class)->find($id);
|
||||||
$task = $taskRepository->find($id);
|
|
||||||
|
|
||||||
if (!$task) {
|
if (!$task) {
|
||||||
throw $this->createNotFoundException('Unable to find Task entity.');
|
throw $this->createNotFoundException('Unable to find Task entity.');
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace Chill\TaskBundle\Repository;
|
namespace Chill\TaskBundle\Repository;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
@ -11,9 +12,11 @@ use Doctrine\DBAL\Types\Type;
|
|||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SingleTaskRepository
|
* Class SingleTaskRepository
|
||||||
|
*
|
||||||
|
* @package Chill\TaskBundle\Repository
|
||||||
*/
|
*/
|
||||||
class SingleTaskRepository extends \Doctrine\ORM\EntityRepository
|
class SingleTaskRepository extends EntityRepository
|
||||||
{
|
{
|
||||||
|
|
||||||
const DATE_STATUS_ENDED = 'ended';
|
const DATE_STATUS_ENDED = 'ended';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user