Builder for entities with cakephp3 - cakephp-3.0

I need some help with my entities in CakePhp 3.
The idea is to set some parameters to a new entitie during the init phase. Maybe with a builder ( function _setPrivateKey( ) ).
I really don't understand how can I do that.
When I write:
$this->Univer->newEntity();
I want to set automatically a property: for example i want to generate the $cleAuthentificationdirectly and without writing $univer->cleAuthentification = ramdomGenerate();in my controller. But with a methode inside the entitie class. ( A builder I gess like in other languages ) But how can i do that ?
Here is my Entitie class:
use Cake\ORM\Entity;
/**
* Univer Entity
*
* #property int $id
* #property int $actif
* #property string $cleAuthentification
* #property string $clePrivee
* #property string $clePublique
* #property \Cake\I18n\Time $dateCreation
* #property \Cake\I18n\Time $dateRelance
* #property \Cake\I18n\Time $dateValidation
* #property \Cake\I18n\Time $dateDernierAppel
* #property string $domaine
* #property string $nom
* #property bool $refreshActif
* #property string $traficMensuelCaptcha
* #property string $traficMensuelSite
* #property int $version
* #property int $categorie_id
* #property int $editeur_id
* #property string $plugin
* #property int $visiteurUniqueMensuel
* #property int $saisieMensuelValide
* #property int $clicMensuel
* #property int $saisieUniqueMensuel
* #property bool $getContent
* #property bool $displayTab
* #property bool $escape
* #property bool $restrictionLDA
* #property int $genre
* #property string $age
* #property float $cpeMin
* #property string $dataComportementale
*
* #property \App\Model\Entity\TechnologyIntegration $technologyIntegration
* #property \App\Model\Entity\Categorie $categorie
* #property \App\Model\Entity\Editeur $editeur
* #property \App\Model\Entity\Theme[] $theme
*/
class Univer extends Entity
{
protected $_accessible = [
'*' => true,
'id' => false
];
}
`
Thx for the help !

A very easy and simple way would be to create a method in the entity like so:
public function initializeValues() {
$this->foo = "bar";
$this->cleAuthentification = this->randomGenerate();
}
and then do following:
$entity = $this->Univer->newEntity();
$entity->initializeValues();
Alternatively, if it would be enough to do this when you want to save the entity, you could place the code in your beforeSave() method in the Table class - see the docs here: http://book.cakephp.org/3.0/en/orm/table-objects.html#beforesave :-)

Related

Doctrine does not automatically load joined relation using GROUP BY

I have two Doctrine entity classes: Vertriebsschiene and Filiale:
/**
* Vertriebsschiene
*
* #ORM\Table(name="vertriebsschiene", indexes={
* #ORM\Index(columns={"name"}, flags={"fulltext"})
* }))
* #ORM\Entity(repositoryClass="CRMBundle\Repository\VertriebsschieneRepository")
*/
class Vertriebsschiene
{
/**
* #var int
*
* #ORM\Column(name="id", type="integer")
* #ORM\Id
* #ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* #var string
*
* #ORM\Column(name="name", type="string", length=100)
*/
private $name;
/**
* #var ArrayCollection
*
* #ORM\OneToMany(targetEntity="Filiale", mappedBy="vertriebsschiene", fetch="EAGER")
*/
private $filialen;
...
}
/**
* Filiale
*
* #ORM\Table(name="filiale")
* #ORM\Entity(repositoryClass="CRMBundle\Repository\FilialeRepository")
*/
class Filiale extends Lieferant
{
/**
* #var Vertriebsschiene
*
* #ORM\ManyToOne(targetEntity="CRMBundle\Entity\Vertriebsschiene", inversedBy="filialen", fetch="EAGER")
*/
private $vertriebsschiene;
...
}
The Vertriebsschine objects have a non-uniqe name. Now I try to display a list of Vertriebsschiene objects with their Filiale objects.
My findAllQuery method looks like this:
/**
* #param User $user
* #return \Doctrine\ORM\Query
*/
public function findAllQuery(User $user){
$qb = $this->createQueryBuilder('v')
->select('v as vertriebsschiene')
->addSelect('COUNT(f) as filial_num')
->leftJoin('v.filialen', 'f')
->groupBy('v.name');
$this->restrictAccess($user, $qb);
return $qb->getQuery();
}
/**
* #param User $user
* #param $qb
*/
protected function restrictAccess(User $user, QueryBuilder &$qb)
{
if ($user->hasRole(RoleVoter::AUSSENDIENST)) {
$qb ->leftJoin('f.vertreter', 'u')
->leftJoin('u.vertretungen', 'vx')
->andWhere($qb->expr()->orX(
'f.vertreter = :userid',
'f.vertreter IS NULL',
$qb->expr()->andX(
'vx.proxy = :userid',
$qb->expr()->between(':currentDate', 'vx.start', 'vx.end')
)
))
->setParameter('userid', $user->getId())
->setParameter('currentDate', new \DateTime(), \Doctrine\DBAL\Types\Type::DATETIME);
}
}
My problem is, that the Vertriebsschiene::$filiale array collection is not automatically loaded, but is loaded for every Vertriebsschiene resulting in many DB connections.
This also has the problem, that the WHERE statement is ignored when the Vertriebsschiene::$filiale is fetched.
The COUNT(f) returns the correct amount of Filiale objects.
I suspect this is an issue with the GROUP BY statement.
I think the problem is that you do not tell doctrine to select filiale fields.
Try to add the filiale alias in your select :
public function findAllQuery(User $user){
$qb = $this->createQueryBuilder('v')
->select('v as vertriebsschiene', 'f')
->addSelect('COUNT(f) as filial_num')
->leftJoin('v.filialen', 'f')
->groupBy('v.name');
$this->restrictAccess($user, $qb);
return $qb->getQuery();
}
If you check your query in the profiler, i think you'll see that doctrine add a LEFT JOIN fialiale f0_ ON v0_.id = f0_.vertriebsschiene_id (or something like this but does not add SELECT ... f0_.id, f0_.xxxx.
So every time you'll call $vertriebsschiene->getFieliale()->getXXX() doctrine will have to execute the corresponding query to get the filiale data.

Doctrine2 findOneBy returning wrong result

I am working on a legacy project using Symfony2.3 and the following versions of doctrine components (composer show -i | grep doctrine):
doctrine/annotations v1.1.2
doctrine/cache v1.2.0
doctrine/collections dev-master bcb5377
doctrine/common 2.4.x-dev c94d6ff
doctrine/data-fixtures dev-master 8ffac1c
doctrine/dbal 2.3.x-dev 59c310b
doctrine/doctrine-bundle dev-master a41322d
doctrine/doctrine-fixtures-bundle dev-master 3caec48
doctrine/doctrine-migrations-bundle dev-master 1a7f58d
doctrine/inflector dev-master 8b4b3cc
doctrine/lexer dev-master bc0e1f0
doctrine/migrations dev-master e960224
doctrine/orm 2.3.x-dev 66d8b43
I had to implement a simple db cache system.
I have a storage table and a service class to access it.
The table schema is as follows:
CREATE TABLE `mlp_api_storage` (
`id` TINYINT(4) NOT NULL AUTO_INCREMENT,
`key` VARCHAR(250) NOT NULL,
`value` TEXT NOT NULL,
`is_serialized` TINYINT(4) NOT NULL,
`created` DATETIME NOT NULL,
`ttl` INT(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `Index 2` (`key`)
)
The big issue I am having with this is one some occasions when I try to retrieve a value I get the wrong result.
I am tailing the log file and I can see the query being executed with the correct key value and if I run that directly in MySQL I will get the value I expect but not with doctrine.
Here is the relevant code of the storage service:
/**
* #param string $key
* #param string $value
* #param mixed $ttl
* #return self
*/
public function set($key, $value, $ttl = null)
{
$em = $this->getEntityManager();
$store = $this->fetchEntity($key);
$update = true;
if (!$store) {
$update = false;
$store = new Storage();
}
$store->setKey($key);
if (is_object($value) || is_array($value)) {
$value = serialize($value);
$store->setIsSerialized(true);
} else {
$store->setIsSerialized(false);
}
$store->setValue($value);
$store->setTtl($this->calculateTTL($ttl));
$store->setCreated(new \DateTime());
if ($update) {
$em->merge($store);
} else {
$em->persist($store);
}
$em->flush($store);
return $this;
}
/**
* #param string $key
* #param mixed $default
* #return string|null
*/
public function fetch($key, $default = null)
{
$res = $this->fetchEntity($key);
if ($res) {
if ($this->isValidStorage($res)) {
$value = $res->getValue();
if ($res->getIsSerialized()) {
$value = unserialize($value);
}
return $value;
}
$this->remove($res);
}
if ($default) {
$res = (is_callable($default)) ? $default($this) : $default;
} else {
$res = null;
}
return $res;
}
/**
* #param string $key
* #return Storage
*/
private function fetchEntity($key)
{
/* #var $res Storage */
$res = $this->getEntityManager()
->getRepository(Storage::class)
->findOneBy(['key' => $key]);
if ($res) {
return $res;
}
return null;
}
So using the debugger (and mysql log) I can see that everything is fine up until the line with : ->findOneBy(['key' => $key]);
This will be set with an entity with a different key and value.
I have setup a small example:
$storage->set('test', '1111111111111111111');
$storage->set('test2', '22222222222222222222');
var_dump($storage->fetch('test'));
var_dump($storage->fetch('test2'));
This is returning:
string '1111111111111111111' (length=19)
string '1111111111111111111' (length=19)
Here is what is in the table:
Here is the mysql log output:
66 Query SELECT t0.`key` AS key1, t0.value AS value2, t0.is_serialized AS is_serialized3, t0.created AS created4, t0.ttl AS ttl5, t0.id AS id6 FROM storage t0 WHERE t0.`key` = 'test' LIMIT 1
66 Query SELECT t0.`key` AS key1, t0.value AS value2, t0.is_serialized AS is_serialized3, t0.created AS created4, t0.ttl AS ttl5, t0.id AS id6 FROM storage t0 WHERE t0.`key` = 'test2' LIMIT 1
Am I doing something wrong with doctrine2? I am updating the entity instead of deleting because doctrine will try to insert before deleting.
Thanks!
UPDATE:
Here is the entity code
namespace PitchBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Storage
*
* #ORM\Table(name="storage")
* #ORM\Entity
*/
class Storage
{
/**
* #var string
*
* #ORM\Column(name="`key`", type="string", length=250, nullable=false)
*/
private $key;
/**
* #var string
*
* #ORM\Column(name="value", type="text", nullable=false)
*/
private $value;
/**
* #var boolean
*
* #ORM\Column(name="is_serialized", type="boolean", nullable=false)
*/
private $isSerialized;
/**
* #var \DateTime
*
* #ORM\Column(name="created", type="datetime", nullable=false)
*/
private $created;
/**
* #var integer
*
* #ORM\Column(name="ttl", type="integer", nullable=true)
*/
private $ttl;
/**
* #var boolean
*
* #ORM\Column(name="id", type="boolean")
* #ORM\Id
* #ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* Set key
*
* #param string $key
* #return Storage
*/
public function setKey($key)
{
$this->key = $key;
return $this;
}
/**
* Get key
*
* #return string
*/
public function getKey()
{
return $this->key;
}
/**
* Set value
*
* #param string $value
* #return Storage
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
/**
* Get value
*
* #return string
*/
public function getValue()
{
return $this->value;
}
/**
* Set isSerialized
*
* #param boolean $isSerialized
* #return Storage
*/
public function setIsSerialized($isSerialized)
{
$this->isSerialized = $isSerialized;
return $this;
}
/**
* Get isSerialized
*
* #return boolean
*/
public function getIsSerialized()
{
return $this->isSerialized;
}
/**
* Set created
*
* #param \DateTime $created
* #return Storage
*/
public function setCreated($created)
{
$this->created = $created;
return $this;
}
/**
* Get created
*
* #return \DateTime
*/
public function getCreated()
{
return $this->created;
}
/**
* Set ttl
*
* #param integer $ttl
* #return Storage
*/
public function setTtl($ttl)
{
$this->ttl = $ttl;
return $this;
}
/**
* Get ttl
*
* #return integer
*/
public function getTtl()
{
return $this->ttl;
}
/**
* Get id
*
* #return boolean
*/
public function getId()
{
return $this->id;
}
}
You have an error in your entity id annotation. Currently it is:
* #ORM\Column(name="id", type="boolean")
* #ORM\Id
* #ORM\GeneratedValue(strategy="IDENTITY")
but it should be
* #ORM\Column(name="id", type="integer")
* #ORM\Id
* #ORM\GeneratedValue(strategy="IDENTITY")

DATE TIME with json format API

sorry for my poor english btw , it's not my mother's tongue .
So i created an API using FOSRestBundle on syfmony 3 :
This one :
public function getHoraireAction(){
$Horaire = $this->getDoctrine()->getRepository('CBMedBundle:Horaire')- >findAll();
if(!$Horaire){
throw $this->createNotFoundException();
}
return $Horaire;
}
Entity Horaire.php with JMSSerializer
<?php
namespace CBMedBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\VirtualProperty;
/**
* Horaire
*
* #ORM\Table(name="horaire")
* #ORM\Entity(repositoryClass="CBMedBundle\Repository\HoraireRepository")
*
* #ExclusionPolicy("all")
*/
class Horaire
{
/**
* #var int
*
* #ORM\Column(name="id", type="integer")
* #ORM\Id
* #ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* #var time
*
* #ORM\Column(name="Debut", type="time", length=10)
* #Expose
*/
private $debut;
/**
* #var time
*
* #ORM\Column(name="EntreeSalle", type="time", length=10)
* #Expose
*/
private $entreeSalle;
/**
* #var time
*
* #ORM\Column(name="HeureAnesthesie", type="time", length=10)
* #Expose
*/
private $heureAnesthesie;
/**
* #var time
*
* #ORM\Column(name="Operation", type="time", length=10)
* #Expose
*/
private $operation;
/**
* #var time
*
* #ORM\Column(name="incision", type="time", length=10)
* #Expose
*/
private $incision;
/**
* #var time
*
* #ORM\Column(name="finOpe", type="time", length=10)
* #Expose
*/
private $finOpe;
/**
* #var time
*
* #ORM\Column(name="Reveil", type="time", length=10)
* #Expose
*/
private $reveil;
/**
* #var time
*
* #ORM\Column(name="Sortie", type="time", length=10)
* #Expose
*/
private $sortie;
/**
* #ORM\OneToOne(targetEntity="CBMedBundle\Entity\Interventions", cascade= {"persist"})
* #Expose
*/
private $Interventions;
etc..
Everything is working , but it seems that the API do not return the true value of fields who have "time" type .
Horaire.php date time datas on mysql
And this is what i get when i test the API (using post man)
Error with Date time
How to fix that please .
Thanks
Ok i have found the solution .
i had to add these lines :
use JMS\Serializer\Annotation\Type;
//.....
/**
* #var time
*
* #ORM\Column(name="Debut", type="time", length=10)
* #Type("DateTime<'h-m-s'>")
* #Expose
*/
private $debut;
etc..

Can I set up a Symfony2 ORM inheritance relationship using MySQL?

I have one table tech_note and I would like to have 3 tables more tech_note_es, tech_note_en and tech_note_fr (in a future many more tables). And the tech_note can be in the 3 tables at same time.
My idea is attach to tech_note_en and automatically receive attributes from tech_note.
SECOND EDIT:
I would like somthing like that: I search in Tech_note_EN by ID=3 (I recive fields from tech_note_EN with ID=3 and fields tech_note with ID=3.
But if I search in Tech_note_ES BY ID=3 (I recive fields from tech_note_ES with ID=3 and tech_note fields from tech_note with ID=3 (the same fields from above)
The tech_note have a ID=3. Tech_note_EN have ID=3, and Tech_note_ES have ID=3
EDIT WITH NEW CLASSES:
Now I have this error:
Entity 'EVTS\FrontendBundle\Entity\Tech_note_en' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported.
TECH_NOTE
abstract class Tech_note {
/**
* #var integer $id
*
* #ORM\Column(name="id", type="integer")
* #ORM\Id
* #ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* #var datetime $control_date
*
* #ORM\Column(name="control_date", type="datetime")
*/
private $control_date;
/**
* #var string $comment
*
* #ORM\Column(name="comment", type="string")
*/
private $comment;
TECH_NOTE_EN
class Tech_note_en extends Tech_note {
/**
* #var integer $tech_note_id
*
* #ORM\Id
* #ORM\Column(name="tech_note_id", type="integer")
* #ORM\OneToOne(targetEntity="tech_note")
* #ORM\JoinColumn(name="tech_note_id",referencedColumnName="id")
*/
private $tech_note_id;
/**
* #var text $symptom
*
* #ORM\Column(name="symptom", type="text")
*/
private $symptom;
/**
* #var text $cause
*
* #ORM\Column(name="cause", type="text")
*/
private $cause;
/**
* #var string $solution
*
* #ORM\Column(name="solution", type="string")
*/
private $solution;
OLD CLASSES
TECH_NOTE
class Tech_note {
/**
* #var integer $id
*
* #ORM\Column(name="id", type="integer")
* #ORM\Id
* #ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* #var datetime $control_date
*
* #ORM\Column(name="control_date", type="datetime")
*/
private $control_date;
/**
* #var string $comment
*
* #ORM\Column(name="comment", type="string")
*/
private $comment;
TECH_NOTE_EN
class Tech_note_en
{
/**
* #var integer $tech_note_id
*
* #ORM\Id
* #ORM\Column(name="tech_note_id", type="integer")
* #ORM\OneToOne(targetEntity="tech_note")
* #ORM\JoinColumn(name="tech_note_id",referencedColumnName="id")
*/
private $tech_note_id;
/**
* #var text $symptom
*
* #ORM\Column(name="symptom", type="text")
*/
private $symptom;
/**
* #var text $cause
*
* #ORM\Column(name="cause", type="text")
*/
private $cause;
/**
* #var string $solution
*
* #ORM\Column(name="solution", type="string")
*/
private $solution;
There is an awesome solution to your problem, which is single table inheritance
What this does is basically Have one central table with general fields, and links to other table with specific fields.
In your case I would use this architectural model:
abstract class TechNote (abstract common entity, which contains common fields)
class TechNoteEn extends TechNote (specific entity which inherits common fields and adds specific EN fields)
and so on.
I find this as the best architectural solution for your problem.
That's your ORM's job.
// Assuming $tech_note_en is a Tech_note_en instance
$tech_note_en->getTechNote();
(something like this ^^)

How to access object method in twig from doctrine inner join

I have a member entity and a friend entity.
I get all the friends of a member by joining the tables.
I join the members on the friends via member_id.
TABLE STRUCTURE:
Members
member_id, full_name, email, password, date_joined
Friends
friendship_id, member_id, friend_id
Everything is fine but I can't get the full_name of the friend_id.
I ran the command line to generate the getters, setters, and join info in the entities.
In twig I get the friends array from the controller and calling friend.fullName returns my name, not my friends names but I joined on member_id that so thats fine.
I need to get the fullName of the member with the id of friend_id without 2 queries.
Ex.
member_id: 1, full_name:John
Friend
member_id: 22, full_name:Billy
I can call friend.friendId and it will return the 22, I'm stumped on getting the fullName
Member Entity
<?php
namespace Pixbelly\AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Pixbelly\AppBundle\Entity\Members
*
* #ORM\Table(name="members")
* #ORM\Entity(repositoryClass="Pixbelly\AppBundle\Repository\MembersRepository")
*/
class Members
{
/**
* #var integer $memberId
*
* #ORM\Column(name="member_id", type="integer", nullable=false)
* #ORM\Id
* #ORM\GeneratedValue(strategy="IDENTITY")
*/
private $memberId;
/**
* #var string $fullName
*
* #ORM\Column(name="full_name", type="string", length=255, nullable=false)
*/
private $fullName;
/**
* #var string $email
*
* #ORM\Column(name="email", type="string", length=255, nullable=false)
*/
private $email;
/**
* #var string $password
*
* #ORM\Column(name="password", type="string", length=255, nullable=false)
*/
private $password;
/**
* #var \DateTime $dateJoined
*
* #ORM\Column(name="date_joined", type="datetime", nullable=false)
*/
private $dateJoined;
/**
* #ORM\OneToMany(targetEntity="Friends", mappedBy="member")
*/
protected $friends;
public function __construct()
{
$this->friends = new ArrayCollection();
}
/**
* Get memberId
*
* #return integer
*/
public function getMemberId()
{
return $this->memberId;
}
/**
* Set fullName
*
* #param string $fullName
* #return Members
*/
public function setFullName($fullName)
{
$this->fullName = $fullName;
return $this;
}
/**
* Get fullName
*
* #return string
*/
public function getFullName()
{
return $this->fullName;
}
/**
* Set email
*
* #param string $email
* #return Members
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email
*
* #return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set password
*
* #param string $password
* #return Members
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Get password
*
* #return string
*/
public function getPassword()
{
return $this->password;
}
/**
* Set dateJoined
*
* #param \DateTime $dateJoined
* #return Members
*/
public function setDateJoined($dateJoined)
{
$this->dateJoined = $dateJoined;
return $this;
}
/**
* Get dateJoined
*
* #return \DateTime
*/
public function getDateJoined()
{
return $this->dateJoined;
}
/**
* Add friends
*
* #param Pixbelly\AppBundle\Entity\Friends $friends
* #return Members
*/
public function addFriend(\Pixbelly\AppBundle\Entity\Friends $friends)
{
$this->friends[] = $friends;
return $this;
}
/**
* Remove friends
*
* #param Pixbelly\AppBundle\Entity\Friends $friends
*/
public function removeFriend(\Pixbelly\AppBundle\Entity\Friends $friends)
{
$this->friends->removeElement($friends);
}
/**
* Get friends
*
* #return Doctrine\Common\Collections\Collection
*/
public function getFriends()
{
return $this->friends;
}
}
Friends Entity
<?php
namespace Pixbelly\AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Pixbelly\AppBundle\Entity\Friends
*
* #ORM\Table(name="friends")
* #ORM\Entity(repositoryClass="Pixbelly\AppBundle\Repository\FriendsRepository")
*/
class Friends
{
/**
* #var integer $id
*
* #ORM\Column(name="friendship_id", type="integer", nullable=false)
* #ORM\Id
* #ORM\GeneratedValue(strategy="IDENTITY")
*/
private $friendshipId;
/**
* #var integer $memberId
*
* #ORM\Column(name="member_id", type="integer", nullable=false)
*/
private $memberId;
/**
* #var integer $friendId
*
* #ORM\Column(name="friend_id", type="integer", nullable=false)
*/
private $friendId;
/**
* #ORM\ManyToOne(targetEntity="Members", inversedBy="friends")
* #ORM\JoinColumn(name="member_id", referencedColumnName="member_id")
*/
protected $member;
/**
* Get friendshipId
*
* #return integer
*/
public function getFriendshipId()
{
return $this->friendshipId;
}
/**
* Set memberId
*
* #param integer $memberId
* #return Friends
*/
public function setMemberId($memberId)
{
$this->memberId = $memberId;
return $this;
}
/**
* Get memberId
*
* #return integer
*/
public function getMemberId()
{
return $this->memberId;
}
/**
* Set friendId
*
* #param integer $friendId
* #return Friends
*/
public function setFriendId($friendId)
{
$this->friendId = $friendId;
return $this;
}
/**
* Get friendId
*
* #return integer
*/
public function getFriendId()
{
return $this->friendId;
}
/**
* Set member
*
* #param Pixbelly\AppBundle\Entity\Members $member
* #return Friends
*/
public function setMember(\Pixbelly\AppBundle\Entity\Members $member = null)
{
$this->member = $member;
return $this;
}
/**
* Get member
*
* #return Pixbelly\AppBundle\Entity\Members
*/
public function getMember()
{
return $this->member;
}
}