Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
technobel.sf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mathieu
technobel.sf
Commits
e8defcd0
Commit
e8defcd0
authored
Jul 10, 2018
by
Mat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
groupe de serialisation pour la route get de Brasserie
parent
7281cc24
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
5 deletions
+32
-5
src/Api2Bundle/Controller/BrasserieController.php
src/Api2Bundle/Controller/BrasserieController.php
+22
-0
src/Api2Bundle/Entity/Brasserie.php
src/Api2Bundle/Entity/Brasserie.php
+5
-3
src/Api2Bundle/Entity/Categorie.php
src/Api2Bundle/Entity/Categorie.php
+1
-1
src/Api2Bundle/Entity/Pays.php
src/Api2Bundle/Entity/Pays.php
+4
-1
No files found.
src/Api2Bundle/Controller/BrasserieController.php
0 → 100644
View file @
e8defcd0
<?php
namespace
Api2Bundle\Controller
;
use
Api2Bundle\Entity\Brasserie
;
use
FOS\RestBundle\Controller\Annotations
as
Rest
;
use
FOS\RestBundle\Controller\FOSRestController
;
class
BrasserieController
extends
FOSRestController
{
/**
* @Rest\Get(path="/brasserie")
* @Rest\View(serializerGroups={"getBrasserie"})
*/
public
function
getAction
()
{
return
$this
->
getDoctrine
()
->
getRepository
(
Brasserie
::
class
)
->
findAll
();
}
}
src/Api2Bundle/Entity/Brasserie.php
View file @
e8defcd0
...
...
@@ -2,8 +2,8 @@
namespace
Api2Bundle\Entity
;
use
Doctrine\Common\Collections\ArrayCollection
;
use
Doctrine\ORM\Mapping
as
ORM
;
use
JMS\Serializer\Annotation
as
Serializer
;
/**
* Brasserie
...
...
@@ -19,6 +19,7 @@ class Brasserie
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Serializer\Groups({"getBrasserie"})
*/
private
$id
;
...
...
@@ -26,20 +27,21 @@ class Brasserie
* @var integer
* @ORM\ManyToOne(targetEntity="Api2Bundle\Entity\Pays")
* @ORM\JoinColumn(name="id_pays", nullable=false)
* @Serializer\Groups({"getBrasserie"})
*/
private
$pays
;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=255)
* @Serializer\Groups({"getBrasserie"})
*/
private
$nom
;
/**
* @var string
*
* @ORM\Column(name="adresse", type="string", length=255, nullable=true)
* @Serializer\Groups({"getBrasserie"})
*/
private
$adresse
;
...
...
src/Api2Bundle/Entity/Categorie.php
View file @
e8defcd0
...
...
@@ -2,9 +2,9 @@
namespace
Api2Bundle\Entity
;
use
Doctrine\Common\Collections\ArrayCollection
;
use
Doctrine\ORM\Mapping
as
ORM
;
/**
* Categorie
*
...
...
src/Api2Bundle/Entity/Pays.php
View file @
e8defcd0
...
...
@@ -2,8 +2,9 @@
namespace
Api2Bundle\Entity
;
use
Doctrine\Common\Collections\ArrayCollection
;
use
Doctrine\ORM\Mapping
as
ORM
;
use
JMS\Serializer\Annotation
as
Serializer
;
/**
* Pays
...
...
@@ -19,6 +20,7 @@ class Pays
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Serializer\Groups({"getBrasserie"})
*/
private
$id
;
...
...
@@ -33,6 +35,7 @@ class Pays
* @var string
*
* @ORM\Column(name="nom", type="string", length=255)
* @Serializer\Groups({"getBrasserie"})
*/
private
$nom
;
...
...
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