Example #1
0
 public function execute()
 {
     $method = explode('.', $this->_task);
     $this->nid = 'field_' . $method[0];
     $method = 'Proxy' . ucfirst($method[1]);
     $this->fid = SPFactory::db()->select('fid', 'spdb_field', array('nid' => $this->nid, 'section' => Sobi::Section()))->loadResult();
     $this->field = SPFactory::Model('field');
     $this->field->init($this->fid);
     $this->field->{$method}();
     return true;
 }
Example #2
0
 /**
  * Proxy pattern
  * @param string $property
  * @return mixed
  */
 public function __get($property)
 {
     if (!isset($this->{$property}) && $this->_field) {
         return $this->_field->get($property);
     } else {
         return $this->get($property);
     }
 }
Example #3
0
 public function loadType($type = null)
 {
     if ($type) {
         $this->type = $type;
     } else {
         $this->type =& $this->fieldType;
     }
     if ($this->type && SPLoader::translatePath('opt.fields.adm.' . $this->type)) {
         SPLoader::loadClass('opt.fields.fieldtype');
         $fType = SPLoader::loadClass('opt.fields.adm.' . $this->type);
         $this->_type = new $fType($this);
     } elseif ($this->type && SPLoader::translatePath('opt.fields.' . $this->type)) {
         SPLoader::loadClass('opt.fields.fieldtype');
         $fType = SPLoader::loadClass('opt.fields.' . $this->type);
         $this->_type = new $fType($this);
     } else {
         parent::loadType();
     }
 }