Ejemplo n.º 1
0
 /**
  * Save Tag
  * @return bollean
  */
 public function save()
 {
     $data = array(self::ID_TAG => $this->getIdTag(), self::TAG => $this->getTag());
     $sql = new Sql();
     if (is_null($this->getIdTag())) {
         $sql->insert($data, self::TABLE);
         $this->idTag = $sql->lastRow(self::TABLE)->id_tag;
         return true;
     } else {
         $pk = array(self::ID_TAG => $this->getIdTag());
         return $sql->update($data, self::TABLE, $pk);
     }
 }
Ejemplo n.º 2
0
 /**
  * Save Log
  * @return bollean
  */
 public function save()
 {
     $data = array(self::ID => self::getId(), self::DATE => self::getDate(), self::FILE => self::getFile(), self::MESSAGE => self::getMessage(), self::IS_ERROR => self::getIsError());
     $sql = new Sql();
     if (is_null($this->getId())) {
         $sql->insert($data, self::TABLE);
         $this->id = $sql->lastRow(self::TABLE)->id;
         return true;
     } else {
         $pk = array(self::ID => self::getId());
         return $sql->update($data, self::TABLE, $pk);
     }
 }
Ejemplo n.º 3
0
 /**
  * Save 
  * @return bollean
  */
 public function save()
 {
     $data = array(self::ISOLANG => $this->getIsoLang(), self::DEFAULT_CULTURE => $this->getDefault());
     $sql = new Sql();
     if (!self::hasCulture($this->getIsoLang())) {
         $sql->insert($data, self::TABLE);
         $this->isolang = $sql->lastRow(self::TABLE)->isolang;
         return true;
     } else {
         $pk = array(self::ISOLANG => $this->getIsoLang());
         return $sql->update($data, self::TABLE, $pk);
     }
 }
Ejemplo n.º 4
0
 /**
  * Save Tag
  * @return bollean
  */
 public function save()
 {
     $data = array(self::ID_TAG_I18N => $this->getIdTagI18n(), self::ID_TAG => $this->getIdTag(), self::ISOLANG => $this->getIsoLang(), self::TRANSLATE => $this->getTranslate());
     $sql = new Sql();
     if (is_null($this->getIdTagI18n())) {
         $sql->insert($data, self::TABLE);
         $this->idTagI18n = $sql->lastRow(self::TABLE) ? $sql->lastRow(self::TABLE)->id_tag_i18n : '';
         $this->idTag = $sql->lastRow(self::TABLE) ? $sql->lastRow(self::TABLE)->id_tag : '';
         return true;
     } else {
         $pk = array(self::ID_TAG_I18N => $this->getIdTagI18n());
         return $sql->update($data, self::TABLE, $pk);
     }
 }