Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
1fe9362e
Commit
1fe9362e
authored
Jun 11, 2021
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix enabled_filter problems
parent
a7df490e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
FormFactory.php
src/Factory/FormFactory.php
+3
-1
Configurator.php
src/Filter/Configurator.php
+3
-2
PrestataireRepository.php
src/Repository/PrestataireRepository.php
+5
-3
AppExtension.php
src/Twig/AppExtension.php
+0
-1
No files found.
src/Factory/FormFactory.php
View file @
1fe9362e
...
@@ -121,7 +121,9 @@ class FormFactory
...
@@ -121,7 +121,9 @@ class FormFactory
$presta
=
$this
->
session
->
get
(
'_prestagere'
);
$presta
=
$this
->
session
->
get
(
'_prestagere'
);
$presta
=
$this
->
em
->
merge
(
$presta
);
$presta
=
$this
->
em
->
merge
(
$presta
);
// Disable enabled_filter to display all adresses
// Disable enabled_filter to display all adresses
$this
->
em
->
getFilters
()
->
disable
(
'enabled_filter'
);
if
(
$this
->
em
->
getFilters
()
->
isEnabled
(
'enabled_filter'
))
{
$this
->
em
->
getFilters
()
->
disable
(
'enabled_filter'
);
}
$form
=
$this
->
ff
->
create
(
PrestataireInfosFormType
::
class
,
$presta
,
[
'action'
=>
$this
->
router
->
generate
(
'prestataire_infos'
)]);
$form
=
$this
->
ff
->
create
(
PrestataireInfosFormType
::
class
,
$presta
,
[
'action'
=>
$this
->
router
->
generate
(
'prestataire_infos'
)]);
return
$form
->
createView
();
return
$form
->
createView
();
...
...
src/Filter/Configurator.php
View file @
1fe9362e
...
@@ -50,8 +50,9 @@ class Configurator
...
@@ -50,8 +50,9 @@ class Configurator
// @TODO : sur le backoffice, mettre un bouton pour afficher les éléments supprimés
// @TODO : sur le backoffice, mettre un bouton pour afficher les éléments supprimés
// (pas vraiment, avec le filtre softdelete) et une variable en session pour activer ou non le filtrer Doctrine
// (pas vraiment, avec le filtre softdelete) et une variable en session pour activer ou non le filtrer Doctrine
// $this->em->getFilters()->disable('softdeleteable');
// $this->em->getFilters()->disable('softdeleteable');
if
(
$this
->
em
->
getFilters
()
->
isEnabled
(
'enabled_filter'
))
{
$this
->
em
->
getFilters
()
->
disable
(
'enabled_filter'
);
$this
->
em
->
getFilters
()
->
disable
(
'enabled_filter'
);
}
}
}
}
}
}
}
src/Repository/PrestataireRepository.php
View file @
1fe9362e
...
@@ -43,8 +43,8 @@ class PrestataireRepository extends ServiceEntityRepository
...
@@ -43,8 +43,8 @@ class PrestataireRepository extends ServiceEntityRepository
public
function
getPrestataireMLC
()
public
function
getPrestataireMLC
()
{
{
if
(
$this
->
_em
->
getFilters
()
->
isEnabled
(
'enabled_filter'
))
{
if
(
$this
->
getEntityManager
()
->
getFilters
()
->
isEnabled
(
'enabled_filter'
))
{
$this
->
_em
->
getFilters
()
->
disable
(
'enabled_filter'
);
$this
->
getEntityManager
()
->
getFilters
()
->
disable
(
'enabled_filter'
);
}
}
$qb
=
$this
->
createQueryBuilder
(
'p'
);
$qb
=
$this
->
createQueryBuilder
(
'p'
);
$result
=
$qb
$result
=
$qb
...
@@ -54,7 +54,9 @@ class PrestataireRepository extends ServiceEntityRepository
...
@@ -54,7 +54,9 @@ class PrestataireRepository extends ServiceEntityRepository
->
getQuery
()
->
getQuery
()
->
getOneOrNullResult
()
->
getOneOrNullResult
()
;
;
// $this->_em->getFilters()->enable('enabled_filter');
if
(
!
$this
->
getEntityManager
()
->
getFilters
()
->
isEnabled
(
'enabled_filter'
))
{
$this
->
getEntityManager
()
->
getFilters
()
->
enable
(
'enabled_filter'
);
}
return
$result
;
return
$result
;
}
}
...
...
src/Twig/AppExtension.php
View file @
1fe9362e
...
@@ -108,7 +108,6 @@ class AppExtension extends AbstractExtension
...
@@ -108,7 +108,6 @@ class AppExtension extends AbstractExtension
public
function
getMLCPrestataire
()
:
?
Prestataire
public
function
getMLCPrestataire
()
:
?
Prestataire
{
{
try
{
try
{
// $this->em->getFilters()->enable('enabled_filter');
$prestaMLC
=
$this
->
em
->
getRepository
(
Prestataire
::
class
)
->
getPrestataireMLC
();
$prestaMLC
=
$this
->
em
->
getRepository
(
Prestataire
::
class
)
->
getPrestataireMLC
();
return
$prestaMLC
;
return
$prestaMLC
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment