Automattic\WooCommerce\Vendor\GraphQL\Utils
MixedStore::offsetGet
Method of the class: MixedStore{}
No Hooks.
Returns
TValue|null.
Usage
$MixedStore = new MixedStore(); $MixedStore->offsetGet( $offset );
- $offset(mixed) (required)
- .
MixedStore::offsetGet() MixedStore::offsetGet code WC 10.9.1
public function offsetGet($offset)
{
if ($offset === true) {
return $this->trueValue;
}
if ($offset === false) {
return $this->falseValue;
}
if (is_int($offset) || is_string($offset)) {
return $this->standardStore[$offset];
}
if (is_float($offset)) {
return $this->floatStore[(string) $offset];
}
if (is_object($offset)) {
return $this->objectStore->offsetGet($offset);
}
if (is_array($offset)) {
// offsetGet is often called directly after offsetExists, so optimize to avoid second loop:
if ($this->lastArrayKey === $offset) {
return $this->lastArrayValue;
}
foreach ($this->arrayKeys as $index => $entry) {
if ($entry === $offset) {
return $this->arrayValues[$index];
}
}
}
if ($offset === null) {
return $this->nullValue;
}
return null;
}