public function toArray($deep = true) { $array = get_object_vars($this); $array['estado'] = $this->estado->toArray(); $array['grupo'] = $this->grupo->toArray($deep); $array['participantes'] = $deep ? array_map(function ($p) { return $p->toArray(false); }, $this->participantes->toArray()) : $this->participantes->count(); return $array; }
/** * Set grupo * * @param \JuegoPostas\AppBundle\Entity\Grupo $grupo * @return Camino */ public function setGrupo(\JuegoPostas\AppBundle\Entity\Grupo $grupo = null) { $this->grupo = $grupo; $grupo->setCamino($this); return $this; }