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
09744fb2
Commit
09744fb2
authored
Jun 09, 2021
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add twig function for presta search
parent
9a1f209f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
PrestataireRepository.php
src/Repository/PrestataireRepository.php
+20
-2
AppExtension.php
src/Twig/AppExtension.php
+2
-2
No files found.
src/Repository/PrestataireRepository.php
View file @
09744fb2
...
@@ -23,6 +23,24 @@ class PrestataireRepository extends ServiceEntityRepository
...
@@ -23,6 +23,24 @@ class PrestataireRepository extends ServiceEntityRepository
parent
::
__construct
(
$registry
,
Prestataire
::
class
);
parent
::
__construct
(
$registry
,
Prestataire
::
class
);
}
}
/**
* @return Prestataire[] Returns an array of Prestataire objects
*/
public
function
findDefault
(
$orderBy
=
'raison'
,
$direction
=
'ASC'
,
$limit
=
null
)
{
$qb
=
$this
->
createQueryBuilder
(
'p'
);
$qb
=
$this
->
addDefaultFilter
(
$qb
);
$qb
->
orderBy
(
'p.'
.
$orderBy
,
$direction
);
if
(
$limit
!=
null
)
{
$qb
->
limit
(
$limit
);
}
return
$qb
->
getQuery
()
->
getResult
()
;
}
public
function
getPrestataireMLC
()
public
function
getPrestataireMLC
()
{
{
if
(
$this
->
_em
->
getFilters
()
->
isEnabled
(
'enabled_filter'
))
{
if
(
$this
->
_em
->
getFilters
()
->
isEnabled
(
'enabled_filter'
))
{
...
@@ -45,11 +63,9 @@ class PrestataireRepository extends ServiceEntityRepository
...
@@ -45,11 +63,9 @@ class PrestataireRepository extends ServiceEntityRepository
$qb
$qb
->
leftJoin
(
'p.etats'
,
't'
)
->
leftJoin
(
'p.etats'
,
't'
)
->
andWhere
(
'p.mlc = :mlc'
)
->
andWhere
(
'p.mlc = :mlc'
)
// ->andWhere('p.acceptemlc = :acceptemlc')
->
andWhere
(
'p.enabled = :enabled'
)
->
andWhere
(
'p.enabled = :enabled'
)
->
andWhere
(
't.enabled != :disabled OR t.enabled IS NULL'
)
->
andWhere
(
't.enabled != :disabled OR t.enabled IS NULL'
)
->
setParameter
(
'mlc'
,
false
)
->
setParameter
(
'mlc'
,
false
)
// ->setParameter('acceptemlc', true)
->
setParameter
(
'enabled'
,
true
)
->
setParameter
(
'enabled'
,
true
)
->
setParameter
(
'disabled'
,
false
)
->
setParameter
(
'disabled'
,
false
)
;
;
...
@@ -123,6 +139,8 @@ class PrestataireRepository extends ServiceEntityRepository
...
@@ -123,6 +139,8 @@ class PrestataireRepository extends ServiceEntityRepository
}
}
/**
/**
* For Prestataire Admin search
*
* @return Prestataire[] Returns an array of Prestataire objects
* @return Prestataire[] Returns an array of Prestataire objects
*/
*/
public
function
findByGroupeLocal
(
Groupe
$groupe
)
public
function
findByGroupeLocal
(
Groupe
$groupe
)
...
...
src/Twig/AppExtension.php
View file @
09744fb2
...
@@ -235,9 +235,9 @@ class AppExtension extends AbstractExtension
...
@@ -235,9 +235,9 @@ class AppExtension extends AbstractExtension
return
$this
->
em
->
getRepository
(
News
::
class
)
->
findBy
([
'enabled'
=>
true
],
[
'createdAt'
=>
'DESC'
],
$limit
);
return
$this
->
em
->
getRepository
(
News
::
class
)
->
findBy
([
'enabled'
=>
true
],
[
'createdAt'
=>
'DESC'
],
$limit
);
}
}
public
function
getAllPrestataires
()
public
function
getAllPrestataires
(
$orderBy
=
'raison'
,
$direction
=
'ASC'
,
$limit
=
null
)
{
{
return
$this
->
em
->
getRepository
(
Prestataire
::
class
)
->
find
By
([
'mlc'
=>
false
,
'enabled'
=>
true
],
[
'raison'
=>
'ASC'
]
);
return
$this
->
em
->
getRepository
(
Prestataire
::
class
)
->
find
Default
(
$orderBy
,
$direction
,
$limit
);
}
}
public
function
getAllGroupePrestataires
(
$type
=
''
)
public
function
getAllGroupePrestataires
(
$type
=
''
)
...
...
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