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

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

If no value is set, default value will be used, and that value will also be assigned as a new attribute value.
public getDbValue ( ) : string
Результат string
    public function getDbValue()
    {
        $value = $this->getValue();
        if ($this->isNull($this->value)) {
            $this->value = $value;
        }
        $value = $this->processToDbValue($value);
        return $this->value = $value;
    }

Usage Example

Пример #1
0
 /**
  * @inheritDoc
  */
 public function getDbValue()
 {
     $value = $this->getValue();
     if ($value instanceof AbstractEntity) {
         return $this->processToDbValue($value->id);
     }
     return parent::getDbValue();
 }