mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 23:04:58 +00:00
Feature: Add filters on activity list
This commit is contained in:
@@ -11,15 +11,22 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Repository;
|
||||
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Entity\ActivityType;
|
||||
use Chill\MainBundle\Entity\UserJob;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
|
||||
interface ActivityACLAwareRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @return Activity[]|array
|
||||
* Return all the activities associated to an accompanying period and that the user is allowed to apply the given role.
|
||||
*
|
||||
*
|
||||
* @param array{my_activities?: bool, types?: array<ActivityType>, jobs?: array<UserJob>, after?: \DateTimeImmutable|null, before?: \DateTimeImmutable|null} $filters
|
||||
* @return array<Activity>
|
||||
*/
|
||||
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array;
|
||||
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, array $orderBy = ['date' => 'DESC'], array $filters = []): array;
|
||||
|
||||
/**
|
||||
* Return a list of activities, simplified as array (not object).
|
||||
@@ -31,7 +38,28 @@ interface ActivityACLAwareRepositoryInterface
|
||||
public function findByAccompanyingPeriodSimplified(AccompanyingPeriod $period, ?int $limit = 1000): array;
|
||||
|
||||
/**
|
||||
* @return Activity[]|array
|
||||
* @param array{my_activities?: bool, types?: array<ActivityType>, jobs?: array<UserJob>, after?: \DateTimeImmutable|null, before?: \DateTimeImmutable|null} $filters
|
||||
* @return array<Activity>
|
||||
*/
|
||||
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array;
|
||||
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, array $orderBy = ['date' => 'DESC'], array $filters = []): array;
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of the type for the activities associated to person or accompanying period
|
||||
*
|
||||
* @return array<ActivityType>
|
||||
*/
|
||||
public function findActivityTypeByAssociated(AccompanyingPeriod|Person $associated): array;
|
||||
|
||||
/**
|
||||
* Return a list of the user job for the activities associated to person or accompanying period
|
||||
*
|
||||
* Associated mean the job:
|
||||
* - of the creator;
|
||||
* - of the user (activity.user)
|
||||
* - of all the users
|
||||
*
|
||||
* @return array<UserJob>
|
||||
*/
|
||||
public function findUserJobByAssociated(AccompanyingPeriod|Person $associated): array;
|
||||
}
|
||||
|
Reference in New Issue
Block a user