Extracts a root field from a raw MongoDB result.

@param   string  $key
@param   array   $data
@return  mixed
@throws  PersisterException
497633
private function extractField($key, array $data)
    {
        if (!isset($data[$key])) {
            throw PersisterException::badRequest(sprintf('Unable to extract a field value. The "%s" key was not found.', $key));
        }
        return $data[$key];
    }
1310812
private function parseFieldRepeaters(array $fields, $key)
    {
        $blacklist = ['repeater', 'slug', 'templatefield'];
        $repeater = $fields[$key];

        if (!isset($repeater['fields']) || !is_array($repeater['fields'])) {
            return;
        }

        foreach ($repeater['fields'] as $repeaterKey => $repeaterField) {
            if (!isset($repeaterField['type']) || in_array($repeaterField['type'], $blacklist)) {
                unset($repeater['fields'][$repeaterKey]);
            }
        }

        return $repeater;
    }
773360
protected function getLexemes(string $key, array $data)
    {
        $syntax = $this->tryLoad($key);

        if (empty($this->data[$key]))
        {
            $syntax = $this->syntax($key, $data);
            $this->syntax2Array($key, $syntax);
        }

        return $syntax;
    }
1328321
public static function decrypt($data, $key = null)
    {
        is_null($key) && $key = Config::get('auth_key');
        return unserialize(self::cry($data, 2, $key));
    }
631980
public function data($key) {
        return !empty($this->_data[$key]) ? $this->_data[$key] : null;
    }
1284735
public static function first(array $data, ?string $key = null)
    {
        if (count($data) === 0) {
            return null;
        }
        reset($data);
        $element = current($data);
        if ($key !== null && is_array($element) && isset($element[$key])) {
            return $element[$key];
        }
        return $element;
    }
1098355
public function pickUp($key)
    {
        return isset($this->_rawData[$key])
            ? $this->factory($this->_rawData[$key])
            : null;
    }
132835
private function createManyToOneRelation(array &$data, $key)
    {
        $uid = isset($data[$key]) ? (int)$data[$key] : 0;

        $data[$key] = ($uid > 0)
            ? \Tx_Oelib_MapperRegistry::get($this->relations[$key])->find($uid)
            : null;
    }
438856
public function data(string $key, array $data = null)
    {
        $this->tryLoad($key);

        if (!\array_key_exists($key, $this->data))
        {
            $this->data[$key] = $this->get($key, $data);
        }

        return $this->data[$key];
    }
24881
public static function createFromArray($key, array $data = [], ApiDefinition $apiDefinition = null)
    {
        $securityScheme = new static($key === 'null' ? null : $key);

        if (isset($data['description'])) {
            $securityScheme->setDescription($data['description']);
        }

        if (isset($data['type'])) {
            $securityScheme->setType($data['type']);
        }

        if (isset($data['describedBy'])) {
            $securityScheme->setDescribedBy(
                SecuritySchemeDescribedBy::createFromArray('describedBy', $data['describedBy'])
            );
        }

        if (isset($data['settings'])) {
            $securityScheme->setSettings($data['settings']);
        }

        return $securityScheme;
    }
703576
protected function _validateDataKey($key, $data)
    {
        $dataOkFlag = true;

        if (!$this->_validationOn) {
            return $dataOkFlag;
        }

        foreach ($this->_validationRules as $ruleKey => $ruleValue) {
            if (!preg_match($ruleKey, $key)) {
                continue;
            }

            $bool = $this->_validateData($ruleValue, $key, $data);
            if (!$bool) {
                $dataOkFlag = false;
            }
        }

        return $dataOkFlag;
    }
841583
private static function recursiveKeyExist($data, $key)
    {
        if (empty($key)) {
            return true;
        } else {
            $currentKey = array_shift($key);
            return isset($data[$currentKey]) ? self::recursiveKeyExist($data[$currentKey], $key) : false;
        }
    }
244988
protected function getRaw($key)
	{
		if (isset($this->dataStore[$key]))
		{
			return $this->dataStore[$key];
		}

		$aliasKey = $this->resolveAlias($key);

		if ($aliasKey !== $key && isset($this->dataStore[$aliasKey]))
		{
			return $this->dataStore[$aliasKey];
		}

		if ($this->parent instanceof Container)
		{
			return $this->parent->getRaw($key);
		}

		if ($this->parent instanceof ContainerInterface && $this->parent->has($key))
		{
			$callback = $this->parent->get($key);

			if (!\is_callable($callback))
			{
				$callback = function () use ($callback)
				{
					return $callback;
				};
			}

			return array(
				'callback'  => $callback,
				'shared'    => true,
				'protected' => true,
			);
		}
	}
486347
protected function getRaw($key)
    {
        $key = $this->resolveAlias($key);

        if (isset($this->dataStore[$key])) {
            return $this->dataStore[$key];
        }

        if ($this->parent instanceof Container) {
            return $this->parent->getRaw($key);
        }

        return null;
    }
395138
public function dump($key, array $data)
    {
        $data = Hash::flatten($data);
        array_walk($data, [$this, '_persist'], $key);
        array_filter($data);

        return (bool)$data;
    }
1329900
public function getRaw($key)
    {
        if (isset(static::$relations[$key])) {
            return $this->getRelation($key);
        }

        return isset($this->values[$key]) ? $this->values[$key] : null;
    }
966702
private function parseKey($data, $key)
    {
        if (isset($data[$key])) {
            $value = (int) $data[$key];
            $this->scoreTiers []= new ScoreTier($key, $value);
            return $value;
        }

        throw new InvalidDataException();
    }