repositories
/
Project_proches_de_moi-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only expose relevant attributes in the Person entity.
[Project_proches_de_moi-server.git]
/
src
/
Entity
/
Person.php
diff --git
a/src/Entity/Person.php
b/src/Entity/Person.php
index d1c7886bf2dfab2cda322d0a2d35322077b85465..7897cfb4454c1b40dd18840f57d1bf942eeeb8e6 100644
(file)
--- a/
src/Entity/Person.php
+++ b/
src/Entity/Person.php
@@
-3,11
+3,17
@@
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
+use JMS\Serializer\Annotation\ExclusionPolicy;
+use JMS\Serializer\Annotation\Expose;
/**
* @ORM\Entity()
* @ORM\Table(name="Person", indexes={@ORM\Index(name="authentification_idx", columns={"email", "password"}),
/**
* @ORM\Entity()
* @ORM\Table(name="Person", indexes={@ORM\Index(name="authentification_idx", columns={"email", "password"}),
- * @ORM\Index(name="search_idx", columns={"firstname", "lastname"})});
+ * @ORM\Index(name="search_idx", columns={"firstname", "lastname", "email"})});
+ * The following annotations tells the serializer to skip all properties which
+ * have not marked with @Expose.
+ *
+ * @ExclusionPolicy("all")
*/
class Person
{
*/
class Person
{
@@
-15,31
+21,37
@@
class Person
* @ORM\Id
* @ORM\Column(type="bigint")
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Id
* @ORM\Column(type="bigint")
* @ORM\GeneratedValue(strategy="AUTO")
+ * @Expose
*/
protected $id;
/**
* @ORM\Column(type="string")
*/
protected $id;
/**
* @ORM\Column(type="string")
+ * @Expose
*/
protected $firstname;
/**
* @ORM\Column(type="string")
*/
protected $firstname;
/**
* @ORM\Column(type="string")
+ * @Expose
*/
protected $lastname;
/**
* @ORM\Column(type="string", unique=true)
*/
protected $lastname;
/**
* @ORM\Column(type="string", unique=true)
+ * @Expose
*/
protected $email;
/**
* @ORM\Column(type="string")
*/
protected $email;
/**
* @ORM\Column(type="string")
+ * @Expose
*/
protected $password;
/**
* @ORM\Column(type="boolean", options={"default":false})
*/
protected $password;
/**
* @ORM\Column(type="boolean", options={"default":false})
+ * @Expose
*/
protected $online;
*/
protected $online;