/** * Create a simple associative array with * an ArrayCollection of Group. * * @param Doctrine\Common\Collections\ArrayCollection $groups * * @return array */ public function toArray($groups) { $data = []; $groupSerializer = new GroupJsonSerializer(); foreach ($groups as $group) { $data[] = $groupSerializer->toArray($group); } return $data; }
/** * Create a simple associative array with * an ArrayCollection of Group. * * @param Doctrine\Common\Collections\ArrayCollection $groups * * @return array */ public static function toArray($groups) { $data = []; foreach ($groups as $group) { $data[] = GroupJsonSerializer::toArray($group); } return $data; }