Used to prepare the custom field array to insert the fields in the database.

@param  array   $fields  list of custom fields
@param  integer $groupID id of custom fields group
@return array
503977
public function prepareCustomFieldArray($fields, $groupID)
    {
        $fieldsQuery = [];
        $count = 0;
        foreach($fields as $field){
            $fieldsQuery[$count]['customFieldGroupID'] = $groupID;
            $fieldsQuery[$count]['tmpID'] = $field['id'];
            $fieldsQuery[$count]['label'] = json_encode($field['label']);
            $fieldsQuery[$count]['placeholder'] = json_encode($field['placeholder']);
            $fieldsQuery[$count]['note'] = json_encode($field['note']);
            $fieldsQuery[$count]['slug'] = $this->generateFieldSlug('', $field['slug'], $field['id'], $fields);
            $fieldsQuery[$count]['type'] = $field['type']['inputType'];
            $fieldsQuery[$count]['order'] = $field['order'];
            $fieldsQuery[$count]['isMultiple'] = $field['isMultiple'];
            $fieldsQuery[$count]['parentID'] = $field['parent'];
            $fieldsQuery[$count]['optionsValues'] = $field['multioptionValues'];
            $fieldsQuery[$count]['isRequired'] = $field['isRequired'];
            $fieldsQuery[$count]['isTranslatable'] = $field['isTranslatable'];
            $fieldsQuery[$count]['isActive'] = $field['isActive'];
            $fieldsQuery[$count]['defaultValue'] = $field['defaultValue'];
            $fieldsQuery[$count]['wrapperStyle'] = json_encode($field['wrapperStyle']);
            $fieldsQuery[$count]['fieldStyle'] = json_encode($field['fieldStyle']);
            $fieldsQuery[$count]['layout'] = $field['layout'];
            $fieldsQuery[$count]['conditions'] = json_encode($field['rules']);

            $properties = [
                'maxWidth' => $field['properties']['maxWidth'],
                'maxHeight' => $field['properties']['maxHeight'],
                'minWidth' => $field['properties']['minWidth'],
                'minHeight' => $field['properties']['minHeight'],
                'maxUploadSize' => $field['properties']['maxUploadSize'],
                'max' => $field['properties']['max'],
                'min' => $field['properties']['min'],
                'dbTable' => $field['properties']['dbTable'],
                'rangeLabel' => $field['properties']['rangeLabel'],
                'rows' => $field['properties']['rows'],
                'allowHTML' => $field['properties']['allowHTML'],
                'allowOther' => $field['properties']['allowOther'],
                'allowParagraphs' => $field['properties']['allowParagraphs'],
                'characterLimit' => $field['properties']['characterLimit'],
                'toolbar' => $field['properties']['toolbar'],
            ];
            $fieldsQuery[$count]['properties'] = json_encode($properties);
            $count++;
        }
        $customFieldsArr = $this->emptyFields($fieldsQuery);
        return $this->divideParentFromChildren($customFieldsArr);
    }
725814
public function getFieldgroupParams(int $fieldgroupId, bool $translate = true) : array
    {
        // Get the fieldgroup
        $fieldgroup = acf_get_field_group($fieldgroupId);

        // Bail if fieldgroup is empty
        if (empty($fieldgroup)) {
            trigger_error('The fieldgroup with id "' . $fieldgroupId . '" is empty.', E_USER_WARNING);
            return array();
        }

        // Get the fields in the fieldgroup
        $fieldgroup['fields'] = acf_get_fields($fieldgroup);

        // Translate
        if ($translate) {
            $fieldgroup = $this->translate($fieldgroup);
        }

        // Preapre for export
        return acf_prepare_field_group_for_export($fieldgroup);
    }
178316
public function stepCreateMemberWithGroup($id, $groupId) {
		$group = $this->fixtureFactory->get('Group', $groupId);
		if(!$group) $group = $this->fixtureFactory->createObject('Group', $groupId);
		
		$member = $this->fixtureFactory->createObject('Member', $id);
		$member->Groups()->add($group);
	}
112524
public function stack($elements, $groupId, $position = null): self
    {
        $group = new Group($groupId);

        $this->filter(function ($element) use ($elements) {
            return in_array($element->id(), $elements, true);
        })->each(function ($element) use ($group) {
            $group->push($element);
            $this->items = $this->without($element->id())->all();
        });

        if ($position) {
            $this->insert($group, $position);
        } else {
            $this->push($group);
        }

        return $this;
    }
396810
public function replaceGroup($groupId, Api\GroupCreate $group)
    {
        $json = Serialize::group($group);
        $result = $this->_put($this->_groupUrl($groupId), $json);
        return Deserialize::groupResponse($result);
    }
755105
public function loadObjectStateGroupData($groupId)
    {
        $query = $this->createObjectStateGroupFindQuery();
        $query->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('id', 'ezcobj_state_group'),
                $query->bindValue($groupId, null, \PDO::PARAM_INT)
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
1270232
protected function fields(array $fields) {
        if (!empty($fields)) {
            if (!is_numeric(key($fields))) {
                $fields = array_keys($fields);
            }
            $this->insertFields = $fields;
        }
        return $this;
    }
1284899
public function group($field, $id)
    {
        if (!isset($this->grouped[$field])) {
            foreach ($this->rows as $row) {
                if (!isset($this->grouped[$field][$row->$field])) {
                    $this->grouped[$field][$row->$field] = [];
                }
                $this->grouped[$field][$row->$field][] = $row;
            }
        }
        $origins = isset($this->grouped[$field][$id]) ? $this->grouped[$field][$id] : [];
        return new Rows($origins, $this->getTable(), $this, $this->model);
    }
1140763
public static function limitationValues( $groupID )
    {
        $group = self::fetchById( $groupID );
        $states = array();

        if ( $group !== false )
            $states = $group->attribute( 'states' );

        $limitationValues = array();
        foreach ( $states as $state )
        {
            $limitationValues[] = array( 'name' => $state->attribute( 'current_translation' )->attribute( 'name' ),
                                         'id'   => $state->attribute( 'id' ) );
        }

        return $limitationValues;
    }
586178
public function insertObjectState(ObjectState $objectState, $groupId)
    {
        try {
            return $this->innerGateway->insertObjectState($objectState, $groupId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
736548
public function GroupBy($Fields = NULL) {
      if(is_null($Fields)) {
         // Group by every item in the select that isn't a function.
         foreach($this->_Selects as $Alias => $Select) {
            if(ArrayValue('Function', $Select) == '') {
               $this->_GroupBys[] = $Select['Field'];
            }
         }
         return $this;
      }
      
      if (is_string($Fields))
         $Fields = explode(',', $Fields);

      foreach ($Fields as $Field) {
         $Field = trim($Field);

         if ($Field != '')
            $this->_GroupBys[] = $this->EscapeIdentifier($Field);
      }
      return $this;
   }
971461
public function loadRoleAssignmentsByGroupId($groupId, $inherited = false)
    {
        $query = $this->handler->createSelectQuery();
        $query->select(
            $this->handler->quoteColumn('id'),
            $this->handler->quoteColumn('contentobject_id'),
            $this->handler->quoteColumn('limit_identifier'),
            $this->handler->quoteColumn('limit_value'),
            $this->handler->quoteColumn('role_id')
        )->from(
            $this->handler->quoteTable('ezuser_role')
        );

        if ($inherited) {
            $groupIds = $this->fetchUserGroups($groupId);
            $groupIds[] = $groupId;
            $query->where(
                $query->expr->in(
                    $this->handler->quoteColumn('contentobject_id'),
                    $groupIds
                )
            );
        } else {
            $query->where(
                $query->expr->eq(
                    $this->handler->quoteColumn('contentobject_id'),
                    $query->bindValue($groupId, null, \PDO::PARAM_INT)
                )
            );
        }

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
1139873
public function getGroup($groupId)
    {
        if (isset($this->_groupIdMap[$groupId])) {
            return $this->_groupIdMap[$groupId];
        }

        $this->_logger->log(Logger::ERROR, sprintf('Group ID "%s" is not in datafile.', $groupId));
        $this->_errorHandler->handleError(new InvalidGroupException('Provided group is not in datafile.'));
        return new Group();
    }
1335893
public function loadObjectStates($groupId)
    {
        $data = $this->objectStateGateway->loadObjectStateListData($groupId);

        return $this->objectStateMapper->createObjectStateListFromData($data);
    }
1174944
public function updateGroup($groupId)
    {
        $group = wei()->group()->findOrInitById($groupId);
        $ret = wei()->event->until('groupMove', [[$this['id']], $group]);
        if ($ret) {
            return $ret;
        }

        $this->save(['groupId' => $groupId]);

        return ['code' => 1, 'message' => '操作成功'];
    }
1223269
public function fetchGroupMembers($groupId)
    {
        $result = $this->_get($this->_groupUrl($groupId, '/members'));
        return Deserialize::groupMembers($result);
    }
548860
public function loadGroup($groupId)
    {
        $groups = $this->mapper->extractGroupsFromRows(
            $this->contentTypeGateway->loadGroupData([$groupId])
        );

        if (count($groups) !== 1) {
            throw new Exception\TypeGroupNotFound($groupId);
        }

        return $groups[0];
    }