/** * Magic method to return the meta data like the post original fields * * @param string $key * @return string */ public function __get($key) { if (!isset($this->{$key})) { if (isset($this->term->{$key})) { return $this->term->{$key}; } } return parent::__get($key); }
public function __get($key) { if (config('gtcms.premium')) { $fullEntity = get_called_class(); $reflection = new \ReflectionClass($fullEntity); $entity = $reflection->getShortName(); $data = GtcmsPremium::getLangDependentPropertyValue($this, $key, $entity); if ($data['valueFound']) { return $data['value']; } } return parent::__get($key); }
public function __get($name) { if ($this->hasConvertAttribute($name)) { $mode = $this->convert_attributes[$name]; $value = isset($this->attributes[$name]) ? $this->attributes[$name] : null; if ($mode == 'date') { if (empty($value) || $value == '0000-00-00 00:00:00') { return ''; } return new Carbon($value); } else { if ($mode == 'json') { if (empty($value)) { return []; } return json_decode($value, true); } } } return is_callable(['parent', '__get']) ? parent::__get($name) : null; }