OwenIt\Auditing\Models\Audit::getDataValue PHP 메소드

getDataValue() 공개 메소드

Get an Audit data value.
public getDataValue ( string $key ) : mixed
$key string
리턴 mixed
    public function getDataValue($key)
    {
        if (!array_key_exists($key, $this->data)) {
            return;
        }
        $value = $this->data[$key];
        // Apply a mutator or a cast the Auditable model may have defined
        if (starts_with($key, ['new_', 'old_'])) {
            $originalKey = substr($key, 4);
            if ($this->auditable->hasGetMutator($originalKey)) {
                return $this->auditable->mutateAttribute($originalKey, $value);
            }
            if ($this->auditable->hasCast($originalKey)) {
                return $this->auditable->castAttribute($originalKey, $value);
            }
        }
        return $value;
    }