@param array $data

@return CountryCollection
483043
public static function createCollection(array $data)
    {
        $countries = array();
        foreach ($data as $countryIdentifier => $countryItem) {
            $languages = array();
            foreach ($countryItem['languages'] as $languageIdentifier => $languageItem) {
                $languages[] = new Language($languageIdentifier, $languageItem['locale'], $languageItem['expose']);
            }

            $countries[] = new Country($countryIdentifier, $countryItem['country'], $countryItem['continent'], new LanguageCollection($languages));
        }

        return new CountryCollection($countries);
    }
212786
public function filter(array $data)
    {
        $data = $this->filterArrayWithGlobalChain($data);

        $this->data = new Container($data);

        $this->filterChains();

        return $this->data->getArrayCopy();
    }
1301006
public final function setFromArray(array $data)
    {
        $dtoClass = $this->_getDtoClass();
        $this->exchangeArray([]);
        foreach ($data as $array) {
            if (!is_array($array)) {
                continue;
            }
            $this->append(new $dtoClass($array));
        }
        return $this;
    }
1041689
public function mapUsers(array $data)
    {
        $users = array();
        foreach ($data as $row) {
            $users[] = $this->mapUser($row);
        }

        return $users;
    }
98412
public function setMany(array $data)
    {
        foreach($data as $key => $value) {
            $this->_data[$key] = $value;
        }

        return $this;
    }
233387
public function import(array $data)
    {
        $this->clearErrors();
        $result = true;

        foreach ($data as $section) {
            if ($this->importItem($section) === false) {
                $result = false;
            }
        }

        return $result;
    }
299194
public function prepareSiteData(array $data)
    {
        if (!empty($data['languageIso6392t'])) {
            $data['language'] = $this->getLanguage($data['languageIso6392t']);
        }

        if (!empty($data['countryId'])) {
            $data['country'] = $this->getCountry($data['countryId']);
        }

        return $data;
    }
1174615
public function buildCountriesCoollection($dataDir)
    {
        $this->helper->message('Processing countries...');

        $mledoze = $this->mledoze->loadMledozeCountries();

        $shapeFile = $this->helper->loadShapeFile('third-party/natural_earth/ne_10m_admin_0_countries');

        $this->helper->message('Generating countries...');

        $countries = coollect($shapeFile)->map(function ($country) {
            return $this->natural->fixNaturalOddCountries($country);
        })->mapWithKeys(function ($natural) use ($mledoze, $dataDir) {
            list($mledoze, $countryCode) = $this->mledoze->findMledozeCountry($mledoze, $natural);

            $natural = coollect($natural)->mapWithKeys(function ($country, $key) {
                return [strtolower($key) => $country];
            });

            if (is_null($countryCode)) {
                $result = $this->mledoze->fillMledozeFields($natural);

                $countryCode = $natural['adm0_a3'];
            } else {
                $result = $this->mledoze->mergeWithMledoze($mledoze, $natural);
            }

            $result = $this->rinvex->mergeWithRinvex(
                $result,
                $this->rinvex->findRinvexCountry($result),
                $this->rinvex->findRinvexTranslations($result)
            );

            $result = $this->clearCountryCurrencies($result);

            $result = $this->updater->addDataSource($result, 'natural');

            $result = $this->updater->addRecordType($result, 'country');

            $result = $result->sortByKeysRecursive();

            $this->helper->putFile(
                $this->helper->makeJsonFileName(strtolower($countryCode), $dataDir),
                $result->toJson(JSON_PRETTY_PRINT)
            );

            $this->helper->message($result['name']['common']);

            return [$countryCode => $result];
        });

        return $mledoze->overwrite($countries);
    }
195595
public function countries(array $countryCodes = null): array
    {
        if (!Configure::read('countries')) {
            Configure::load('CkTools.countries');
        }
        if ($countryCodes) {
            $countries = Configure::read('countries');
            $subset = [];
            foreach ($countryCodes as $countryCode) {
                $subset[$countryCode] = $countries[$countryCode] ?? $countryCode;
            }

            return $subset;
        }

        return Configure::read('countries');
    }
1069423
private function setValues(array $data)
    {
        foreach ($data as $key => $datum) {
            $this->set($key, $datum);
        }
        return $this;
    }
896590
public function fitsToCountry($data) {
		if (!isset($data['country_id']) || !isset($data['country_province_id'])) {
			return true;
		}
		$res = $this->Countries->States->find('list', [
			'conditions' => ['country_id' => $data['country_id']]
		])->toArray();
		if (empty($res) || array_shift($data) == 0) {
			$data['country_province_id'] = 0;
		} elseif (empty($data['country_province_id']) || !array_key_exists($data['country_province_id'], $res)) {
			return false;
		}
		return true;
	}
1103266
public static function createFromArray(array $data)
    {
        $self = new self();

        foreach ($data as $searchResult) {
            $self->addSearchResult(KeySearchResult::createFromArray($searchResult));
        }

        return $self;
    }
32618
private function mapDataToFactObjects(array $data)
    {
        return array_map(function($factData) {
            return (new Fact)
                ->setText($factData['text'])
                ->setGroups($factData['groups'])
            ;
        }, $data);
    }
366302
public function getMeLikes(array $data = [])
    {
        $response = $this->request->get("me/likes", $data);
        return new Collection($this->master, $response, "Pin");
    }
59246
protected function __apiStore(array $data = null)
    {
        if (is_null($data))
            $data = $this->getInputData();

        $record = Galleries::create(array_get($data, 'record'));
        $record->updateTranslations(array_get($data, 'translations'));
        $record->images()->sync(array_get($data, 'images'));

        return $this->apiShow($record->id);
    }
454917
public static function fromArray(array $data)
    {
        $iniSections = IniParser::i()->parseArray($data);

        return self::fromIniSections($iniSections);
    }
1051078
public function createObjectStateFromData(array $data)
    {
        $objectState = new ObjectState();

        $languageIds = [(int)$data[0]['ezcobj_state_default_language_id']];
        foreach ($data as $stateTranslation) {
            $languageIds[] = (int)$stateTranslation['ezcobj_state_language_language_id'] & ~1;
        }
        $languages = $this->languageHandler->loadList($languageIds);

        $objectState->id = (int)$data[0]['ezcobj_state_id'];
        $objectState->groupId = (int)$data[0]['ezcobj_state_group_id'];
        $objectState->identifier = $data[0]['ezcobj_state_identifier'];
        $objectState->priority = (int)$data[0]['ezcobj_state_priority'];
        $objectState->defaultLanguage = $languages[(int)$data[0]['ezcobj_state_default_language_id']]->languageCode;

        $objectState->languageCodes = array();
        $objectState->name = array();
        $objectState->description = array();

        foreach ($data as $stateTranslation) {
            $languageCode = $languages[$stateTranslation['ezcobj_state_language_language_id'] & ~1]->languageCode;
            $objectState->languageCodes[] = $languageCode;
            $objectState->name[$languageCode] = $stateTranslation['ezcobj_state_language_name'];
            $objectState->description[$languageCode] = $stateTranslation['ezcobj_state_language_description'];
        }

        return $objectState;
    }