Webiny\Component\Entity\Attribute\AbstractAttribute::getValue PHP Метод

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

Get attribute value
public getValue ( array $params = [], boolean $processCallbacks = true )
$params array
$processCallbacks boolean Process `onGet` callbacks
    public function getValue($params = [], $processCallbacks = true)
    {
        $value = $this->value;
        $defaultValue = $this->getDefaultValue();
        if ($this->isNull($value) && !$this->isNull($defaultValue)) {
            $value = $defaultValue;
        }
        return $this->processGetValue($value, $params, $processCallbacks);
    }

Usage Example

Пример #1
0
 public function getValue($params = [], $asDateTimeObject = false)
 {
     if ($asDateTimeObject) {
         return $this->processGetValue(new DateTimeObject(parent::getValue()), $params);
     }
     return $this->processGetValue(parent::getValue(), $params);
 }
All Usage Examples Of Webiny\Component\Entity\Attribute\AbstractAttribute::getValue