__get() public method

If not overridden, this is primarily used as a shortcut for the fuel() method. Descending classes may have their own __get() but must pass control to this one when they can't find something.
public __get ( string $name ) : mixed | null
$name string
return mixed | null
 public function __get($key)
 {
     if ($key == 'delimiter') {
         return $this->delimeter;
     }
     // @todo learn how to spell
     return parent::__get($key);
 }
Beispiel #2
0
 public function __get($key)
 {
     $value = $this->get($key);
     if (is_null($value)) {
         $value = parent::__get($key);
     }
     return $value;
 }
 public function __get($key)
 {
     if ($key == 'pdo') {
         return $this->pdo;
     }
     return parent::__get($key);
 }
 /**
  * Handle non-function versions of some properties
  *
  */
 public function __get($key)
 {
     if ($key == 'path') {
         return $this->path();
     }
     if ($key == 'url') {
         return $this->url();
     }
     if ($key == 'page') {
         return $this->page;
     }
     return parent::__get($key);
 }
Beispiel #5
0
 /**	
  * Return a fuel or other property set to the Pages instance
  *
  */
 public function __get($key)
 {
     if ($key == 'outputFormatting') {
         return $this->outputFormatting;
     }
     if ($key == 'cloning') {
         return $this->cloning;
     }
     return parent::__get($key);
 }
 /**
  * Provides direct reference access to retrieve values in the $data array
  *
  * If the given $key is an object, it will cast it to a string. 
  * If the given key is a strain with "|" pipe characters in it, it will try all till it finds a value. 
  *
  * @param string|object $key
  * @return mixed|null Returns null if the key was not found. 
  *
  */
 public function get($key)
 {
     if (is_object($key)) {
         $key = "{$key}";
     }
     if (array_key_exists($key, $this->data)) {
         return $this->data[$key];
     }
     if (strpos($key, '|')) {
         $keys = explode('|', $key);
         foreach ($keys as $k) {
             if ($value = $this->get($k)) {
                 return $value;
             }
         }
     }
     return parent::__get($key);
     // back to Wire
 }
Beispiel #7
0
 /**	
  * Return a fuel or other property set to the Pages instance
  *
  */
 public function __get($key)
 {
     return parent::__get($key);
 }
 /**
  * Enables derefencing of WireArray elements in object notation. 
  *
  * Example: $myArray->myElement
  * Not applicable to numerically indexed arrays. 
  * Fuel properties and hooked properties have precedence with this type of call.
  * 
  * @param int|string $property 
  * @return mixed Value of requested index, or false if it doesn't exist. 
  *
  */
 public function __get($property)
 {
     $value = parent::__get($property);
     if (is_null($value)) {
         $value = $this->getProperty($property);
     }
     if (is_null($value)) {
         $value = $this->get($property);
     }
     return $value;
 }
 public function __get($key)
 {
     return isset($this->data[$key]) ? $this->data[$key] : parent::__get($name);
 }