Gets a subresource operation attribute, optionally fallback to a resource attribute.

@param mixed|null $defaultValue
164792
public function getSubresourceOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
    {
        return $this->findOperationAttribute($this->subresourceOperations, $operationName, $key, $defaultValue, $resourceFallback);
    }
1169742
public function get($keyName, $defaultValue = null)
    {
        $this->initList();
        $keyName = strtolower($keyName);
        if (empty($this->list[$keyName])) {
            return $defaultValue;
        }
        return $this->list[$keyName];
    }
799526
public function getValue(string $key, $defaultValue = null)
    {
        if (isset($this->orgData[$key])) {
            if (isset($this->removeAttributes[$key])) {
                // 已经被删除
                return $defaultValue;
            } elseif (isset($this->updateAttributes[$key])) {
                // 被修改
                return $this->updateAttributes[$key];
            }
            return $this->orgData[$key];
        } else {
            if (isset($this->addAttributes[$key])) {
                return $this->addAttributes[$key];
            }
            return $defaultValue;
        }
    }
311716
private function getBooleanOperationAttribute(string $resourceClass, array $options, string $attributeName, bool $default): bool
    {
        $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);

        if (isset($options['collection_operation_name'])) {
            $attribute = $resourceMetadata->getCollectionOperationAttribute($options['collection_operation_name'], $attributeName, null, true);
        } elseif (isset($options['item_operation_name'])) {
            $attribute = $resourceMetadata->getItemOperationAttribute($options['item_operation_name'], $attributeName, null, true);
        } else {
            $attribute = $resourceMetadata->getAttribute($attributeName);
        }

        return \is_bool($attribute) ? $attribute : $default;
    }
449106
public function getCollectionOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
    {
        return $this->findOperationAttribute($this->collectionOperations, $operationName, $key, $defaultValue, $resourceFallback);
    }
271684
public function get($key, $defaultValue = null)
    {
        if (isset($this->session[$key]) && !empty($this->session[$key])) {
            return $this->session[$key];
        }

        return $defaultValue;
    }
1261088
public function getSession($name = null, $defaultValue = null)
    {
        if ($name === null) {
            return $_SESSION;
        }
        return (isset($_SESSION[$name])) ? $_SESSION[$name] : $defaultValue;
    }
151617
public function get($index, $defaultValue = null)
    {
        $index = (string) $index;

        $items = $this->getItems();

        return isset($items[$index]) ? $items[$index] : $defaultValue;
    }
194049
protected function getValueAttribute(SimpleXMLElement $content, string $use, $default = null)
    {
        return $this->castValue($this->getRawValueAttribute($content, $use, $default));
    }
763421
protected function getPost($param = null, $defaultValue = null)
    {
        if ($param === null) {
            return $this->getRequest()->getPost();
        }

        return $this->getRequest()->getPost($param, $defaultValue);
    }
692477
protected function extractDefault($defaultValue)
	{
		if($this->dbType==='timestamp' )
			$this->defaultValue=null;
		else
			parent::extractDefault(str_replace(array('(',')',"'"), '', $defaultValue));
	}
1369785
protected function extractDefault($defaultValue)
	{
		if(strncmp($this->dbType,'bit',3)===0)
			$this->defaultValue=bindec(trim($defaultValue,'b\''));
		elseif(($this->dbType==='timestamp' || $this->dbType==='datetime')  && ($defaultValue==='CURRENT_TIMESTAMP' || $defaultValue==='current_timestamp()'))
			$this->defaultValue=null;
		else
			parent::extractDefault($defaultValue);
	}
266289
public function get($id, $defaultValue = null)
    {
        if ($this->contains($id)) {
            return $this->fetch($id);
        }

        return $defaultValue;
    }
758490
public static function get($name, $defaultValue = null)
    {
        $model = self::find()->where([self::getNameAttribute() => $name])->asArray()->one();
    
        if ($model) {
            return $model[self::getValueAttribute()];
        }
    
        return $defaultValue;
    }
773816
public function get($key, $defaultValue = null)
    {
        $rawValue = $this->getEnvironmentVariable($key);

        return $this->getValue($rawValue, $defaultValue);
    }
159385
protected function option($name, $defaultValue = null)
    {
        $value = $this->getInput()->getOption($name);

        if (null === $value) {
            return $defaultValue;
        }

        return $value;
    }
834730
protected function getPropertyValue($property, $default = null)
    {
        if (array_key_exists($property, $this->properties)) {
            return $this->properties[$property];
        }

        return $default;
    }