Rapsys Git
/
airbundle
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f6b5969
)
Add locale member
author
Raphaël Gertz
<git@rapsys.eu>
Wed, 31 Jan 2024 21:54:55 +0000
(22:54 +0100)
committer
Raphaël Gertz
<git@rapsys.eu>
Wed, 31 Jan 2024 21:54:55 +0000
(22:54 +0100)
Repository/EntityRepository.php
patch
|
blob
|
history
diff --git
a/Repository/EntityRepository.php
b/Repository/EntityRepository.php
index 927d08031926aba300d4de40afbbfb38dcab5ce6..38436491cf5f1a58ddfd476662547bfc78faea11 100644
(file)
--- a/
Repository/EntityRepository.php
+++ b/
Repository/EntityRepository.php
@@
-67,6
+67,13
@@
class EntityRepository extends BaseEntityRepository {
*/
protected array $languages = [];
*/
protected array $languages = [];
+ /**
+ * The current locale
+ *
+ * @var string
+ */
+ protected string $locale;
+
/**
* Initializes a new LocationRepository instance
*
/**
* Initializes a new LocationRepository instance
*
@@
-76,14
+83,18
@@
class EntityRepository extends BaseEntityRepository {
* @param SluggerUtil $slugger The SluggerUtil instance
* @param TranslatorInterface $translator The TranslatorInterface instance
* @param array $languages The languages list
* @param SluggerUtil $slugger The SluggerUtil instance
* @param TranslatorInterface $translator The TranslatorInterface instance
* @param array $languages The languages list
+ * @param string $locale The current locale
*/
*/
- public function __construct(EntityManagerInterface $manager, ClassMetadata $class, RouterInterface $router, SluggerUtil $slugger, TranslatorInterface $translator, array $languages) {
+ public function __construct(EntityManagerInterface $manager, ClassMetadata $class, RouterInterface $router, SluggerUtil $slugger, TranslatorInterface $translator, array $languages
, string $locale
) {
//Call parent constructor
parent::__construct($manager, $class);
//Set languages
$this->languages = $languages;
//Call parent constructor
parent::__construct($manager, $class);
//Set languages
$this->languages = $languages;
+ //Set locale
+ $this->locale = $locale;
+
//Set router
$this->router = $router;
//Set router
$this->router = $router;
@@
-144,6
+155,9
@@
class EntityRepository extends BaseEntityRepository {
':pnratio' => 1,
//XXX: tr_ratio diff over which considered at regular delay
':trdiff' => 5,
':pnratio' => 1,
//XXX: tr_ratio diff over which considered at regular delay
':trdiff' => 5,
+ //Set locale
+ //XXX: or $manager->getConnection()->quote($this->locale) ???
+ ':locale' => $dp->quoteStringLiteral($this->locale),
//XXX: Set limit used to workaround mariadb subselect optimization
':limit' => PHP_INT_MAX,
"\t" => '',
//XXX: Set limit used to workaround mariadb subselect optimization
':limit' => PHP_INT_MAX,
"\t" => '',