diff --git a/config/packages/mapping/TaskEntity.orm.xml b/config/packages/mapping/TaskEntity.orm.xml new file mode 100644 index 0000000..a4a58f5 --- /dev/null +++ b/config/packages/mapping/TaskEntity.orm.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Repository/TaskRepository.php b/src/Repository/TaskRepository.php new file mode 100644 index 0000000..bc0f9ca --- /dev/null +++ b/src/Repository/TaskRepository.php @@ -0,0 +1,34 @@ + 'asc', + ]; + + /** + * {@inheritdoc} + */ + public function findAll(): array + { + return $this->findBy([], ActivityRepository::DEFAULT_ORDER); + } + + /** + * {@inheritdoc} + */ + public function createQueryBuilder($alias, $indexBy = null): QueryBuilder + { + $queryBuilder = parent::createQueryBuilder($alias, $indexBy); + foreach ($this::DEFAULT_ORDER as $field => $order) { + $queryBuilder->addOrderBy($alias . '.' . $field, $order); + } + + return $queryBuilder; + } +} \ No newline at end of file