Example #1
0
 /**
  * Getter magic method.
  * Get rest parameters.
  *
  * @param string $name
  */
 public function __get($name)
 {
     if ($name == 'restParams') {
         return $this->request->getRestParams();
     }
     return parent::__get($name);
 }
 /**
  * PHP getter magic method.
  * This method is overridden so that AR attributes can be accessed like properties.
  * @param string $name property name
  * @return mixed property value
  * @see getAttribute
  */
 public function __get($name)
 {
     $getter = 'get' . ucfirst($name);
     if (method_exists($this, $getter)) {
         return $this->{$getter}();
     }
     return parent::__get($name);
 }
 public function __get($name)
 {
     if ($name == 'dic') {
         return $this->dic = new TwigContainer();
     } else {
         return parent::__get($name);
     }
 }
Example #4
0
 /**
  * Return an object property
  * 
  * @param string $strKey The property name
  * 
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     if (isset($this->arrData[$strKey])) {
         return $this->arrData[$strKey];
     }
     return parent::__get($strKey);
 }
Example #5
0
 /**
  * Return an object property
  * 
  * Supported keys:
  * 
  * * id:       the field ID
  * * name:     the field name
  * * label:    the field label
  * * value:    the field value
  * * class:    one or more CSS classes
  * * template: the template name
  * * wizard:   the field wizard markup
  * * required: makes the widget a required field
  * 
  * @param string $strKey The property name
  * 
  * @return string The property value
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'id':
             return $this->strId;
             break;
         case 'name':
             return $this->strName;
             break;
         case 'label':
             return $this->strLabel;
             break;
         case 'value':
             // Encrypt the value
             if ($this->arrConfiguration['encrypt']) {
                 return \Encryption::encrypt($this->varValue);
             }
             return $this->varValue;
             break;
         case 'class':
             return $this->strClass;
             break;
         case 'template':
             return $this->strTemplate;
             break;
         case 'wizard':
             return $this->strWizard;
             break;
         case 'required':
             return $this->arrConfiguration[$strKey];
             break;
         case 'forAttribute':
             return $this->blnForAttribute;
             break;
         default:
             if (isset($this->arrAttributes[$strKey])) {
                 return $this->arrAttributes[$strKey];
             } elseif (isset($this->arrConfiguration[$strKey])) {
                 return $this->arrConfiguration[$strKey];
             }
             break;
     }
     return parent::__get($strKey);
 }
Example #6
0
 /**
  * Getter
  *
  * @param string $name
  * @return mixed|\wpdb
  */
 public function __get($name)
 {
     switch ($name) {
         case 'db':
             global $wpdb;
             return $wpdb;
             break;
         default:
             return parent::__get($name);
             break;
     }
 }
Example #7
0
 /**
  * Return an object property
  *
  * @param string $strKey The property name
  *
  * @return string The property value
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'id':
             return $this->strId;
             break;
         case 'name':
             return $this->strName;
             break;
         case 'label':
             return $this->strLabel;
             break;
         case 'value':
             // Encrypt the value
             if ($this->arrConfiguration['encrypt']) {
                 return \Encryption::encrypt($this->varValue);
             } elseif ($this->varValue == '') {
                 return $this->getEmptyStringOrNull();
             }
             return $this->varValue;
             break;
         case 'class':
             return $this->strClass;
             break;
         case 'prefix':
             return $this->strPrefix;
             break;
         case 'template':
             return $this->strTemplate;
             break;
         case 'wizard':
             return $this->strWizard;
             break;
         case 'required':
             return $this->arrConfiguration[$strKey];
             break;
         case 'forAttribute':
             return $this->blnForAttribute;
             break;
         case 'dataContainer':
             return $this->objDca;
             break;
         case 'activeRecord':
             return $this->objDca->activeRecord;
             break;
         default:
             if (isset($this->arrAttributes[$strKey])) {
                 return $this->arrAttributes[$strKey];
             } elseif (isset($this->arrConfiguration[$strKey])) {
                 return $this->arrConfiguration[$strKey];
             }
             break;
     }
     return parent::__get($strKey);
 }
Example #8
0
 /**
  * Reference to short access core modules
  */
 public function __get($name)
 {
     return App::$cur->__get($name);
 }