X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FEntity%2FPerson.php;h=91ffc15938e668db97b2eddcdc2cacfa40252e34;hb=d70022a0a4329a97ee2f996678801d824dbe818c;hp=701b9e63cc6a550591be4a919a690e2b3193eb2a;hpb=dec6d0310680edbf06e4564590d6e4a3ffde8a6e;p=Project_proches_de_moi-server.git diff --git a/src/Entity/Person.php b/src/Entity/Person.php index 701b9e6..91ffc15 100644 --- 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 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\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 { @@ -154,7 +160,7 @@ class Person $this->friends_with_me->add($friendship); } - public function addFriend(User $friend) + public function addFriend(Person $friend) { $fs = new Friendship(); $fs->setPerson($this);