コード例 #1
0
 /**
  * Create a simple associative array with Group entity.
  *
  * @param RZ\Roadiz\Core\Entities\Group $group
  *
  * @return array
  */
 public function toArray($group)
 {
     $data = [];
     $data['name'] = $group->getName();
     $data['roles'] = [];
     foreach ($group->getRolesEntities() as $role) {
         $data['roles'][] = $this->roleSerializer->toArray($role);
     }
     return $data;
 }
コード例 #2
0
 /**
  * Create a simple associative array with Group entity.
  *
  * @param RZ\Roadiz\Core\Entities\Group $group
  *
  * @return array
  */
 public static function toArray($group)
 {
     $data = [];
     $data['name'] = $group->getName();
     $data['roles'] = [];
     foreach ($group->getRolesEntities() as $role) {
         $data['roles'][] = RoleJsonSerializer::toArray($role);
     }
     return $data;
 }