Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mathieu
potage
Commits
7cb09523
Commit
7cb09523
authored
Jul 03, 2018
by
Mat
Browse files
voilà, la profondeur de 3 empêche d'avoir une requête trop longue
parent
40649db4
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/APIBundle/Controller/MasterAPIController.php
View file @
7cb09523
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
APIBundle\Controller
;
namespace
APIBundle\Controller
;
use
JMS\Serializer\SerializationContext
;
use
PotageBundle\Controller\MasterController
;
use
PotageBundle\Controller\MasterController
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
...
@@ -17,7 +18,7 @@ abstract class MasterAPIController extends MasterController
...
@@ -17,7 +18,7 @@ abstract class MasterAPIController extends MasterController
protected
function
api
(
$data
,
$status
=
200
)
protected
function
api
(
$data
,
$status
=
200
)
{
{
$serializer
=
$this
->
get
(
'jms_serializer'
);
$serializer
=
$this
->
get
(
'jms_serializer'
);
$serialized
=
$serializer
->
serialize
(
$data
,
'json'
);
$serialized
=
$serializer
->
serialize
(
$data
,
'json'
,
SerializationContext
::
create
()
->
enableMaxDepthChecks
()
);
// if ($data instanceof Form) {
// if ($data instanceof Form) {
// $status = 400;
// $status = 400;
...
...
src/PotageBundle/Entity/Utilisateur.php
View file @
7cb09523
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
PotageBundle\Entity
;
namespace
PotageBundle\Entity
;
use
JMS\Serializer\Annotation\MaxDepth
;
use
Symfony\Component\Validator\Constraints
as
Assert
;
use
Symfony\Component\Validator\Constraints
as
Assert
;
use
Doctrine\Common\Collections\ArrayCollection
;
use
Doctrine\Common\Collections\ArrayCollection
;
use
Doctrine\Common\Collections\Collection
;
use
Doctrine\Common\Collections\Collection
;
...
@@ -39,6 +40,7 @@ class Utilisateur
...
@@ -39,6 +40,7 @@ class Utilisateur
* joinColumns={@ORM\JoinColumn(name="id_groupe", referencedColumnName="id")},
* joinColumns={@ORM\JoinColumn(name="id_groupe", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="id_utilisateur", referencedColumnName="id")}
* inverseJoinColumns={@ORM\JoinColumn(name="id_utilisateur", referencedColumnName="id")}
* )
* )
* @MaxDepth(3)
*/
*/
private
$groupes
;
private
$groupes
;
...
...
src/PotageBundle/Repository/UtilisateurRepository.php
View file @
7cb09523
...
@@ -23,11 +23,6 @@ class UtilisateurRepository extends \Doctrine\ORM\EntityRepository
...
@@ -23,11 +23,6 @@ class UtilisateurRepository extends \Doctrine\ORM\EntityRepository
public
function
findAllForAPIReadPaginate
(
$paginate
,
$start
,
$column
=
null
,
$order
=
null
)
public
function
findAllForAPIReadPaginate
(
$paginate
,
$start
,
$column
=
null
,
$order
=
null
)
{
{
$qb
=
$this
->
createQueryBuilder
(
'u'
)
$qb
=
$this
->
createQueryBuilder
(
'u'
)
//->select('u.id', 'u.nom', 'u.prenom', 'u.email', 'u.createdAt', 'u.updatedAt')
//->leftJoin('u.groupes', 'g')
//->addSelect('g.id gid', 'g.nom gNom')
//->leftJoin('u.user', 'fu')
//->addSelect('fu.id fuid', 'fu.email fuemail', 'fu.username funame')
->
setMaxResults
(
$paginate
)
->
setMaxResults
(
$paginate
)
->
setFirstResult
((
$start
-
1
)
*
$paginate
);
->
setFirstResult
((
$start
-
1
)
*
$paginate
);
if
(
$column
!==
null
)
{
if
(
$column
!==
null
)
{
...
...
src/PotageBundle/Resources/config/routing.yml
100644 → 100755
View file @
7cb09523
File mode changed from 100644 to 100755
Write
Preview
Supports
Markdown
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