public function store()
 {
     try {
         if (!$this->isInDatabase()) {
             $this->params["ref_access"] = AccesRecord::getInstance()->id;
         }
         if (strlen($this->params["time_published"]) < 1) {
             $this->params["time_published"] = time();
         }
         if (strlen($this->params["url_cs"]) < 1) {
             $this->params["url_cs"] = LBoxUtil::getURLByNameString($this->params["name_cs"]);
         }
         if (strlen($this->params["url_sk"]) < 1) {
             $this->params["url_sk"] = LBoxUtil::getURLByNameString($this->params["name_sk"]);
         }
         if (strlen($this->params["url_en"]) < 1) {
             $this->params["url_en"] = LBoxUtil::getURLByNameString($this->params["name_en"]);
         }
         if (strlen($this->params["name_sk"]) < 1 && strlen($this->params["name_cs"]) > 0) {
             $this->params["name_sk"] = $this->params["name_cs"];
         }
         if (strlen($this->params["name_en"]) < 1 && strlen($this->params["name_cs"]) > 0) {
             $this->params["name_en"] = $this->params["name_cs"];
         }
         if (strlen($this->params["url_sk"]) < 1 && strlen($this->params["url_cs"]) > 0) {
             $this->params["url_sk"] = $this->params["url_cs"];
         }
         if (strlen($this->params["url_en"]) < 1 && strlen($this->params["url_cs"]) > 0) {
             $this->params["url_en"] = $this->params["url_cs"];
         }
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
 public function store()
 {
     try {
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #3
0
 public function store()
 {
     try {
         if (!$this->isInDatabase()) {
             $this->params["created"] = date("Y-m-d H:i:s");
         }
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #4
0
 public function store()
 {
     try {
         if (!$this->params["created"]) {
             $this->params["created"] = time();
         }
         if (!$this->params["type"]) {
             $this->params["type"] = "discussion";
         }
         $this->params["ref_acces"] = AccesRecord::getInstance()->id;
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
 public function store()
 {
     try {
         if (strlen($this->params["url_cs"]) < 1) {
             $this->params["url_cs"] = LBoxUtil::getURLByNameString($this->params["name_cs"]);
         }
         if (strlen($this->params["url_sk"]) < 1) {
             $this->params["url_sk"] = LBoxUtil::getURLByNameString($this->params["name_sk"]);
         }
         if (strlen($this->params["url_en"]) < 1) {
             $this->params["url_en"] = LBoxUtil::getURLByNameString($this->params["name_en"]);
         }
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #6
0
 public function store()
 {
     try {
         if (!$this->params["time_published"] || strtolower($this->params["time_published"]) == "<<null>>") {
             $this->params["time_published"] = time();
         }
         if (strlen($this->params["url_cs"]) < 1 || $this->params["url_cs"] == "<<NULL>>") {
             $this->params["url_cs"] = LBoxUtil::getURLByNameString($this->params["heading_cs"]);
         }
         if (strlen($this->params["url_sk"]) < 1 || $this->params["url_sk"] == "<<NULL>>") {
             $this->params["url_sk"] = LBoxUtil::getURLByNameString($this->params["heading_sk"]);
         }
         $this->params["ref_access"] = AccesRecord::getInstance()->id;
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #7
0
 public function store()
 {
     try {
         if (!$this->params["created"]) {
             $this->params["created"] = date("Y-m-d H:i:s");
         }
         if (!$this->params["ref_xtRole"]) {
             $this->params["ref_xtRole"] = LBoxXT::getRoleRecordByName(LBoxXT::XT_ROLE_NAME_USER)->id;
         }
         if (!$this->isInDatabase()) {
             $this->params["hash"] = md5($this->get("nick") . $this->hashString . $this->get("password"));
         }
         parent::store();
         // vygenerovani hashe
         if (strlen(trim($this->params["hash"])) < 1) {
             $hashString = "kiou5s" . (string) rand(1, 9999) . $this->params[self::$idColName];
             $this->__set("hash", md5((string) $hashString));
         }
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #8
0
 public function store()
 {
     try {
         $this->params["ext"] = strtolower($this->params["ext"]);
         if ($this->params["ext"] == "jpeg") {
             $this->params["ext"] = "jpg";
             $this->synchronized = false;
         }
         if (!is_numeric($this->params["size_x"])) {
             $this->params["size_x"] = $this->getImgX();
             $this->synchronized = false;
         }
         if (!is_numeric($this->params["size_y"])) {
             $this->params["size_y"] = $this->getImgY();
             $this->synchronized = false;
         }
         if (!is_numeric($this->params["size"])) {
             $this->params["size"] = @filesize($this->getFilePath());
             $this->synchronized = false;
         }
         if (!is_numeric($this->params["ref_photogallery"])) {
             $this->params["ref_photogallery"] = "<<NULL>>";
         }
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #9
0
 public function store()
 {
     try {
         // v pripade, ze nepouzivame databazi, access se neuklada
         if (LBoxConfigManagerProperties::getPropertyContentByName("log_access") < 1) {
             return;
         }
         if (!array_key_exists("request_time", $this->params) || !$this->params["request_time"]) {
             $this->params["request_time"] = LBOX_REQUEST_REQUEST_TIME;
         }
         if (array_key_exists("ref_xtuser", $this->params) && !is_numeric($this->params["ref_xtuser"])) {
             $this->params["ref_xtuser"] = "******";
         }
         $this->params["session_id"] = session_id();
         // pro jistotu na 2 pokusy
         try {
             parent::store();
         } catch (DbControlException $e) {
             try {
                 $idColName = $this->getClassVar("idColName");
                 $this->params[$idColName] = $this->getMaxId() + 1;
                 parent::store();
             } catch (Exception $e) {
                 throw $e;
             }
         }
     } catch (Exception $e) {
         throw $e;
     }
 }