Ejemplo n.º 1
0
 public function __get($name)
 {
     if (isset($this->_setting[strtolower($name)])) {
         return $this->_setting[$name];
     }
     throw new CException(Ibos::t("yii", "Property \"{class}.{property}\" is not defined.", array("{class}" => get_class($this), "{property}" => $name)));
 }
Ejemplo n.º 2
0
 public function __set($name, $value)
 {
     $setter = "set" . $name;
     if (method_exists($this, $setter)) {
         return $this->{$setter}($value);
     } elseif (isset($this->_attributes[$name])) {
         return $this->_attributes[$name] = $value;
     }
     if (method_exists($this, "get" . $name)) {
         throw new CException(Ibos::t("yii", "Property \"{class}.{property}\" is read only.", array("{class}" => get_class($this), "{property}" => $name)));
     } else {
         throw new CException(Ibos::t("yii", "Property \"{class}.{property}\" is not defined.", array("{class}" => get_class($this), "{property}" => $name)));
     }
 }
Ejemplo n.º 3
0
 public function create($data = "")
 {
     if (empty($data)) {
         $data = $_POST;
     } elseif (is_object($data)) {
         $data = get_object_vars($data);
     }
     if (empty($data) || !is_array($data)) {
         throw new DataException(Ibos::t("Data type invalid", "error"));
     }
     $fields = $this->getAttributes();
     if (isset($fields)) {
         foreach ($data as $key => $val) {
             if (!array_key_exists($key, $fields)) {
                 unset($data[$key]);
             }
         }
     }
     return $data;
 }
Ejemplo n.º 4
0
 public function init()
 {
     if (!ModuleUtil::getIsEnabled("statistics")) {
         $this->error(Ibos::t("Module \"{module}\" is illegal.", "error", array("{module}" => Ibos::lang("Statistics"))), $this->createUrl("default/index"));
     }
 }
Ejemplo n.º 5
0
 private function chkInstance($adapter)
 {
     if (!$adapter instanceof ICIM) {
         throw new CException(Ibos::t("error", "Class \"{class}\" is illegal.", array("{class}" => get_class($adapter))));
     }
 }
Ejemplo n.º 6
0
 private function chkInstance($chart)
 {
     if (!$chart instanceof ICChart) {
         throw new CException(Ibos::t("error", "Class \"{class}\" is illegal.", array("{class}" => get_class($chart))));
     }
 }