mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
apply timelineSingleQuery on events
This commit is contained in:
parent
75c586fbf8
commit
cad8174333
@ -23,6 +23,7 @@ namespace Chill\EventBundle\Timeline;
|
|||||||
use Chill\EventBundle\Entity\Event;
|
use Chill\EventBundle\Entity\Event;
|
||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Chill\MainBundle\Timeline\TimelineProviderInterface;
|
use Chill\MainBundle\Timeline\TimelineProviderInterface;
|
||||||
|
use Chill\MainBundle\Timeline\TimelineSingleQuery;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
@ -88,13 +89,14 @@ class TimelineEventProvider implements TimelineProviderInterface
|
|||||||
$metadataParticipation = $this->em->getClassMetadata('ChillEventBundle:Participation');
|
$metadataParticipation = $this->em->getClassMetadata('ChillEventBundle:Participation');
|
||||||
$metadataPerson = $this->em->getClassMetadata('ChillPersonBundle:Person');
|
$metadataPerson = $this->em->getClassMetadata('ChillPersonBundle:Person');
|
||||||
|
|
||||||
$query = array(
|
$query = TimelineSingleQuery::fromArray([
|
||||||
'id' => $metadataEvent->getTableName().'.'.$metadataEvent->getColumnName('id'),
|
'id' => $metadataEvent->getTableName().'.'.$metadataEvent->getColumnName('id'),
|
||||||
'type' => 'event',
|
'type' => 'event',
|
||||||
'date' => $metadataEvent->getTableName().'.'.$metadataEvent->getColumnName('date'),
|
'date' => $metadataEvent->getTableName().'.'.$metadataEvent->getColumnName('date'),
|
||||||
'FROM' => $this->getFromClause($metadataEvent, $metadataParticipation, $metadataPerson),
|
'FROM' => $this->getFromClause($metadataEvent, $metadataParticipation, $metadataPerson),
|
||||||
'WHERE' => $this->getWhereClause($metadataEvent, $metadataParticipation, $metadataPerson, $args['person'])
|
'WHERE' => $this->getWhereClause($metadataEvent, $metadataParticipation, $metadataPerson, $args['person']),
|
||||||
);
|
'parameters' => []
|
||||||
|
]);
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
@ -238,4 +240,4 @@ class TimelineEventProvider implements TimelineProviderInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ services:
|
|||||||
- '@chill.main.security.authorization.helper'
|
- '@chill.main.security.authorization.helper'
|
||||||
- '@security.token_storage'
|
- '@security.token_storage'
|
||||||
public: true
|
public: true
|
||||||
# tags:
|
tags:
|
||||||
# - { name: chill.timeline, context: 'person' }
|
- { name: chill.timeline, context: 'person' }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user