createUserFilter($container); $this->createProjectFilter($container); $this->createTaskFilter($container); return $container; } public function createUserFilter(Container $container) { $container['userQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); $builder->withQuery($c['db']->table(UserModel::TABLE)); return $builder; }); return $container; } public function createProjectFilter(Container $container) { $container['projectGroupRoleQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); $builder->withQuery($c['db']->table(ProjectGroupRoleModel::TABLE)); return $builder; }); $container['projectUserRoleQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); $builder->withQuery($c['db']->table(ProjectUserRoleModel::TABLE)); return $builder; }); $container['projectQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); $builder->withQuery($c['db']->table(ProjectModel::TABLE)); return $builder; }); $container['projectActivityLexer'] = $container->factory(function ($c) { $builder = new LexerBuilder(); $builder ->withQuery($c['projectActivityModel']->getQuery()) ->withFilter(new ProjectActivityTaskTitleFilter(), true) ->withFilter(new ProjectActivityTaskStatusFilter()) ->withFilter(new ProjectActivityProjectNameFilter()) ->withFilter(ProjectActivityCreationDateFilter::getInstance() ->setDateParser($c['dateParser']) ) ->withFilter(ProjectActivityCreatorFilter::getInstance() ->setCurrentUserId($c['userSession']->getId()) ) ; return $builder; }); $container['projectActivityQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); $builder->withQuery($c['projectActivityModel']->getQuery()); return $builder; }); return $container; } public function createTaskFilter(Container $container) { $container['taskQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); $builder->withQuery($c['taskFinderModel']->getExtendedQuery()); return $builder; }); $container['taskLexer'] = $container->factory(function ($c) { $builder = new LexerBuilder(); $builder ->withQuery($c['taskFinderModel']->getExtendedQuery()) ->withFilter(TaskAssigneeFilter::getInstance() ->setCurrentUserId($c['userSession']->getId()) ) ->withFilter(new TaskCategoryFilter()) ->withFilter(TaskColorFilter::getInstance() ->setColorModel($c['colorModel']) ) ->withFilter(new TaskPriorityFilter()) ->withFilter(new TaskColumnFilter()) ->withFilter(new TaskCommentFilter()) ->withFilter(TaskCreationDateFilter::getInstance() ->setDateParser($c['dateParser']) ) ->withFilter(TaskCreatorFilter::getInstance() ->setCurrentUserId($c['userSession']->getId()) ) ->withFilter(new TaskDescriptionFilter()) ->withFilter(TaskDueDateFilter::getInstance() ->setDateParser($c['dateParser']) ) ->withFilter(TaskStartDateFilter::getInstance() ->setDateParser($c['dateParser']) ) ->withFilter(new TaskIdFilter()) ->withFilter(TaskLinkFilter::getInstance() ->setDatabase($c['db']) ) ->withFilter(TaskModificationDateFilter::getInstance() ->setDateParser($c['dateParser']) ) ->withFilter(TaskMovedDateFilter::getInstance() ->setDateParser($c['dateParser']) ) ->withFilter(new TaskProjectFilter()) ->withFilter(new TaskReferenceFilter()) ->withFilter(new TaskStatusFilter()) ->withFilter(TaskSubtaskAssigneeFilter::getInstance() ->setCurrentUserId($c['userSession']->getId()) ->setDatabase($c['db']) ) ->withFilter(new TaskSwimlaneFilter()) ->withFilter(TaskTagFilter::getInstance() ->setDatabase($c['db']) ) ->withFilter(new TaskTitleFilter(), true) ; return $builder; }); return $container; } }