Illuminate\Database\Eloquent\Model::__isset PHP Method

__isset() public method

Determine if an attribute or relation exists on the model.
public __isset ( string $key ) : boolean
$key string
return boolean
    public function __isset($key)
    {
        return !is_null($this->getAttribute($key));
    }

Usage Example

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);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::__isset
Model