GraphQL\Utils\MixedStore::offsetExists PHP Метод

offsetExists() публичный Метод

Whether a offset exists
С версии: 5.0.0
public offsetExists ( mixed $offset ) : boolean
$offset mixed

An offset to check for.

Результат boolean true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

    public function offsetExists($offset)
    {
        if (is_scalar($offset)) {
            return array_key_exists($offset, $this->scalarStore);
        }
        if (is_object($offset)) {
            return $this->objectStore->offsetExists($offset);
        }
        if (is_array($offset)) {
            foreach ($this->arrayKeys as $index => $entry) {
                if ($entry === $offset) {
                    $this->lastArrayKey = $offset;
                    $this->lastArrayValue = $this->arrayValues[$index];
                    return true;
                }
            }
        }
        return false;
    }