__isset() public method

Determine if an attribute or relation exists on the model.
public __isset ( string $key ) : boolean
$key string
return boolean
Exemplo n.º 1
0
 /**
  * Check if an attribute exists.
  *
  * @param string $key
  * @return bool
  */
 public function __isset($key)
 {
     return in_array($key, $this->translatedAttributes) || parent::__isset($key);
 }
Exemplo n.º 2
0
 /**
  * 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);
 }
Exemplo n.º 3
0
 /**
  * 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]);
     }
 }
Exemplo n.º 4
0
 /**
  * Determine if an attribute exists on the model.
  *
  * @param  string  $key
  * @return bool
  */
 public function __isset($key)
 {
     return parent::__isset(snake_case($key));
 }