/** * Check if an attribute exists. * * @param string $key * @return bool */ public function __isset($key) { return in_array($key, $this->translatedAttributes) || parent::__isset($key); }
/** * Checks if a field isset while taking into account localized attributes * * @param string $key The key * * @return boolean */ public function __isset($key) { if ($this->polyglot) { if (in_array($key, $this->getPolyglotAttributes())) { return true; } } return parent::__isset($key); }
/** * Override magic isset so we can check for identifier metadata and properties. * @param string $key * @return bool */ public function __isset($key) { $result = parent::__isset($key); if ($result) { return $result; } // if (! $result && $key == 'identifier') { // $resourceModel = $this->getResourceModel(); // if ($resourceModel && $resourceModel instanceof AdminModel) { // return ! is_null($resourceModel->getIdentifier()); // } // } // If we don't have a value try to find it in metadata if (!$result && $key != 'meta') { return isset($this->meta[$key]); } }
/** * Determine if an attribute exists on the model. * * @param string $key * @return bool */ public function __isset($key) { return parent::__isset(snake_case($key)); }