From 62ee90f671b38766cdba0fbd852ed62ecfe53637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 19 Oct 2018 14:27:46 +0200 Subject: [PATCH] add repository for center --- CHANGELOG.md | 2 +- Repository/CenterRepository.php | 27 ++++++++++++++++++++++ Resources/config/doctrine/Center.orm.yml | 1 + Resources/config/services/repositories.yml | 8 +++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Repository/CenterRepository.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 58162daed..19e1ccf23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,5 +20,5 @@ Master branch - layout of page "list exports" - create function "SIMILARITY" (see [posgtgresql documentation](https://www.postgresql.org/docs/9.6/static/pgtrgm.html)) - create function "OVERLAPSI", which will detect period of date overlapping, replacing NULL date by infinity or -infinity (see [postgresql page for date time function and operators](https://www.postgresql.org/docs/9.6/static/functions-datetime.html)) - +- add repository for Center class diff --git a/Repository/CenterRepository.php b/Repository/CenterRepository.php new file mode 100644 index 000000000..05a439bfd --- /dev/null +++ b/Repository/CenterRepository.php @@ -0,0 +1,27 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\MainBundle\Repository; + +/** + * + * + */ +class CenterRepository extends \Doctrine\ORM\EntityRepository +{ + +} diff --git a/Resources/config/doctrine/Center.orm.yml b/Resources/config/doctrine/Center.orm.yml index 8ac4355cc..c09a18bf7 100644 --- a/Resources/config/doctrine/Center.orm.yml +++ b/Resources/config/doctrine/Center.orm.yml @@ -1,6 +1,7 @@ Chill\MainBundle\Entity\Center: type: entity table: centers + repositoryClass: Chill\MainBundle\Repository\CenterRepository id: id: type: integer diff --git a/Resources/config/services/repositories.yml b/Resources/config/services/repositories.yml index 56ea84656..897fd4313 100644 --- a/Resources/config/services/repositories.yml +++ b/Resources/config/services/repositories.yml @@ -24,4 +24,12 @@ services: - "Chill\\MainBundle\\Entity\\PostalCode" Chill\MainBundle\Repository\PostalCodeRepository: '@chill.main.postalcode_repository' + + chill.main.center_repository: + class: Doctrine\ORM\EntityRepository + factory: ["@doctrine.orm.entity_manager", getRepository] + arguments: + - "Chill\\MainBundle\\Entity\\Center" + + Chill\MainBundle\Repository\CenterRepository: '@chill.main.center_repository' \ No newline at end of file