Exemple #1
0
 /**
  * busca todos os highlightss conforme requisições na HighlightsInfoPostVO
  * @return ReturnResultVO
  */
 public function selectHighlights()
 {
     $table = DataHandler::forceString($this->HighlightsInfoPostVO->request_table);
     $table_id = DataHandler::forceInt($this->HighlightsInfoPostVO->request_table_id);
     $quant_start = DataHandler::forceInt($this->HighlightsInfoPostVO->request_quant_start);
     $quant_limit = DataHandler::forceInt($this->HighlightsInfoPostVO->request_quant_limit);
     $type_of_return = DataHandler::forceString($this->HighlightsInfoPostVO->request_type_of_return);
     $locale = DataHandler::forceString($this->HighlightsInfoPostVO->request_locale);
     // se nao foi passado table e table id naum da pra procurar
     if ($table == NULL && $table_id < 1) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->result = $this->array_highlights;
         $ReturnResultVO->array_messages[] = Translation::text("LibraryLanguage::ERROR_HIGHLIGHTS_NOT_FOUND");
         return $ReturnResultVO;
     }
     //inicia a LinkDAO para fazer a consulta
     $DAO = HighLightsDAO::getInstance();
     //busca highlightss vinculados a tabela e tabela id passados
     $ReturnDataVO = $DAO->selectByTableId($table, $table_id, $type_of_return, "highlights", $quant_limit, $quant_start);
     if ($ReturnDataVO->success) {
         //Debug::print_r($ReturnDataVO);exit();
         $ReturnResultVO->success = $ReturnDataVO->success;
         $ReturnResultVO->result = $ReturnDataVO->result;
         return $ReturnResultVO;
     } else {
         $ReturnResultVO->success = $ReturnDataVO->success;
         $ReturnResultVO->result = $this->array_highlights;
         $ReturnResultVO->array_messages[] = Translation::text("LibraryLanguage::ERROR_HIGHLIGHTS_NOT_FOUND");
         return $ReturnResultVO;
     }
 }
Exemple #2
0
 /**
  * @param $id
  * @param $active
  * @param $table
  * @param $table_id
  * @param $guide_name
  * @param $locale
  * @param $link
  * @return unknown_type
  */
 public function update($id, $active = 1, $table = NULL, $table_id = NULL, $linked_table = NULL, $linked_table_id = NULL, $order = NULL)
 {
     $ReturnDataVO = new ReturnDataVO();
     //echo "<li>update</li>";
     if ($id == NULL && $id <= 0) {
         $ReturnDataVO->success = FALSE;
         $ReturnDataVO->code_return = DbInterface::ERROR_LINK_UPDATE_DONOT_HAVE_ID;
         return $ReturnDataVO;
     }
     $arrayFilter = array();
     $query = "UPDATE link SET ";
     $comma = "";
     if ($active !== NULL) {
         $query .= "{$comma}  `active` = '" . DataHandler::forceInt($active) . "'";
         $comma = ", ";
     }
     if ($table != NULL) {
         $query .= " {$comma} `table` = '" . DataHandler::forceString($table) . "'";
         $comma = " , ";
     }
     if ($table_id != NULL) {
         $query .= " {$comma} `table_id` = '" . DataHandler::forceInt($table_id) . "'";
         $comma = " , ";
     }
     if ($linked_table != NULL) {
         $query .= " {$comma} `linked_table` = '" . DataHandler::forceString($linked_table) . "'";
         $comma = ", ";
     }
     if ($linked_table_id != NULL) {
         $query .= "{$comma} `linked_table_id` = '" . DataHandler::forceInt($linked_table_id) . "'";
         $comma = ", ";
     }
     if ($order !== NULL) {
         $query .= "{$comma} `order` = '" . DataHandler::forceInt($order) . "'";
         $comma = ", ";
     }
     $query .= " WHERE id = '" . DataHandler::forceInt($id) . "' LIMIT 1 ";
     if ($comma == "") {
         $ReturnDataVO->success = FALSE;
         $ReturnDataVO->code_return = DbInterface::ERROR_LINK_UPDATE_DONOT_HAVE_UPDATES;
         return $ReturnDataVO;
     } else {
         $ReturnDataVO = parent::query($query);
         if (!$ReturnDataVO->success) {
             $ReturnDataVO->code_return = DbInterface::ERROR_LINK_UPDATE_COMMIT;
         }
         return $ReturnDataVO;
     }
 }
Exemple #3
0
 /**
  * @param $locale
  * 
  */
 public function setLocale($locale)
 {
     $this->locale = DataHandler::forceString($locale);
 }
Exemple #4
0
 private function addFilter(&$query, $id, $active, $state_id, $state, $country, $alias, $street, $number)
 {
     if ($id !== NULL) {
         $query .= " AND id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($state_id !== NULL) {
         $query .= " AND `state_id` = '" . DataHandler::forceInt($state_id) . "'";
     }
     if ($state !== NULL) {
         $query .= " AND `state` = '" . DataHandler::forceString($state) . "'";
     }
     if ($country !== NULL) {
         $query .= " AND `country` = '" . DataHandler::forceString($country) . "'";
     }
     if ($alias !== NULL) {
         $query .= " AND `alias` = '" . DataHandler::forceString($alias) . "'";
     }
     if ($street !== NULL) {
         $query .= " AND `street` = '" . DataHandler::forceString($street) . "'";
     }
     if ($number !== NULL) {
         $query .= " AND `number` = '" . DataHandler::forceString($number) . "'";
     }
     //adiciona a ordenação na query
 }
Exemple #5
0
 public function select($typeOfReturn = NULL, $id = NULL, $active = NULL, $name = NULL, $url = NULL, $author = NULL, $order_type = DbInterface::ORDER_ASC, $quant_limit = NULL, $quant_started = NULL)
 {
     $typeOfReturn = $typeOfReturn === NULL ? NULL : $typeOfReturn;
     $order_type = parent::verifyOrderType($order_type);
     //echo "login[".$login."] - password[".$password."]";
     $arrayFilter = array();
     $query = "SELECT * FROM `image` WHERE 1";
     if ($id !== NULL) {
         $query .= " AND `id` = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($name !== NULL) {
         $query .= " AND `name` = '" . DataHandler::forceString($name) . "'";
     }
     if ($url !== NULL) {
         $query .= " AND `url` = '" . DataHandler::forceString($url) . "'";
     }
     if ($author !== NULL) {
         $query .= " AND `author` = '" . DataHandler::forceString($author) . "'";
     }
     //limite
     $query .= parent::limit($quant_limit, $quant_started);
     $query .= " ORDER BY `order` {$order_type} ";
     //executa a query
     $ReturnDataVO = parent::query($query);
     //verifica se conseguiu ocorreu tudo certo
     if ($ReturnDataVO->success) {
         switch ($typeOfReturn) {
             case DbInterface::RETURN_ARRAY:
                 $ReturnDataVO->fetchAll(ReturnDataVO::TYPE_FETCH_ARRAY);
                 break;
             case DbInterface::RETURN_VO:
                 $ReturnDataVO->fetchAllVO($this);
                 break;
             case DbInterface::RETURN_STD_OBJECT:
             default:
                 //retornar tudo em objeto
                 $ReturnDataVO->fetchAll(ReturnDataVO::TYPE_FETCH_OBJECT);
                 break;
         }
         return $ReturnDataVO;
     } else {
         return $ReturnDataVO;
     }
 }
Exemple #6
0
 private function addFilter(&$query, $id, $active, $category_id, $name, $slug, $order_type)
 {
     if ($id !== NULL) {
         $query .= " AND id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($category_id !== NULL) {
         $query .= " AND `category_id` = '" . DataHandler::forceInt($category_id) . "'";
     }
     if ($name !== NULL) {
         $query .= " AND `name` = '" . DataHandler::forceString($name) . "'";
     }
     if ($slug !== NULL) {
         $query .= " AND `slug` = '" . DataHandler::forceString($slug) . "'";
     }
     //adiciona a ordenação na query
     $orderBy = "";
     if ($order_type != NULL) {
         $order_type = parent::verifyOrderType($order_type);
         $orderBy .= " `order` " . $order_type;
     }
     if ($orderBy != NULL) {
         $query .= " ORDER BY " . $orderBy;
     }
 }
Exemple #7
0
 private function consultValues()
 {
     $ProductModelQuadroDAO = ProductModelQuadroDAO::getInstance();
     $this->MaterialDAO = MaterialDAO::getInstance();
     $this->ColorDAO = ColorDAO::getInstance();
     $this->StyleDAO = StyleDAO::getInstance();
     $this->FormatDAO = FormatDAO::getInstance();
     $this->ThemeDAO = ThemeDAO::getInstance();
     $this->CompositionDAO = CompositionDAO::getInstance();
     $this->TechniqueDAO = TechniqueDAO::getInstance();
     $this->TypeDAO = TypeDAO::getInstance();
     //fazendo o que precisa fazer para ter os dados do menu
     $this->arrayMaterial = $this->MaterialDAO->select(MaterialDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayMaterial);
     $this->arrayColor = $this->ColorDAO->select(ColorDAO::RETURN_VO, NULL, 1);
     // $this->addTotal($this->arrayColor);
     //Debug::print_r($this->arrayColor);
     //busca as imagens
     if ($this->arrayColor->success) {
         $tempVO = array();
         foreach ($this->arrayColor->result as $ColorVO) {
             $tempStdColor = $ColorVO->toStdClass();
             //primeira letra maiuscula
             $tempStdColor->name = ucfirst($tempStdColor->name);
             $tempVO[] = $tempStdColor;
             //Debug::print_r($tempVO);
         }
         $this->arrayColor->result = $tempVO;
     }
     $this->arrayStyle = $this->StyleDAO->select(StyleDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayStyle);
     $this->arrayFormat = $this->FormatDAO->select(FormatDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayFormat);
     $this->arrayTheme = $this->ThemeDAO->select(ThemeDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayTheme);
     $this->arrayComposition = $this->CompositionDAO->select(CompositionDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayComposition);
     $this->arrayTechnique = $this->TechniqueDAO->select(TechniqueDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayTechnique);
     $this->arrayType = $this->TypeDAO->select(TypeDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayType);
     //define a base da url
     $this->url_final = Config::getRootPath("quadros/filter");
     $this->arrayBreadCrumb = array();
     if ($this->arrayVariable != NULL) {
         $temp_array = array_splice($this->arrayRestFolder, 2, count($this->arrayRestFolder) - 1);
         //Debug::print_r($temp_array);
         //exit();
         if ($this->arrayRestFolder[1] == "filter") {
             $this->url_final .= "/" . implode("/", $temp_array);
             //tirando a página da url final
             $this->url_final = preg_replace("/\\/pag\\.[0-9]+?/", "", $this->url_final);
         }
         $array_relacao_variavel_resultado = array();
         $array_relacao_variavel_resultado["search"] = "requestSearch";
         $array_relacao_variavel_resultado["material"] = "requestMaterial";
         $array_relacao_variavel_resultado["color"] = "requestColor";
         $array_relacao_variavel_resultado["style"] = "requestStyle";
         $array_relacao_variavel_resultado["format"] = "requestFormat";
         $array_relacao_variavel_resultado["theme"] = "requestTheme";
         $array_relacao_variavel_resultado["composition"] = "requestComposition";
         $array_relacao_variavel_resultado["technique"] = "requestTechnique";
         $array_relacao_variavel_resultado["type"] = "requestType";
         $array_relacao_variavel_resultado["promocoes"] = "requestPromocao";
         foreach ($this->arrayVariable as $variable => $value) {
             if ($variable == "search" && DataHandler::forceString($value) != NULL) {
                 $this->requestResumeSearch = DataHandler::forceString(urldecode($value));
                 if (strlen($this->requestResumeSearch) > 10) {
                     $this->requestResumeSearch = substr($this->requestResumeSearch, 0, 10) . "...";
                 }
             }
             if (DataHandler::forceInt($value) > 0) {
                 if (isset($array_relacao_variavel_resultado[$variable]) && $array_relacao_variavel_resultado[$variable] != null) {
                     $this->{$array_relacao_variavel_resultado}[$variable] = DataHandler::forceInt(trim($value));
                 }
             } else {
                 //se não nenhum desses itens segnifica q é sujeira por isso não grava na url
                 continue;
             }
             //popula o bread crumb de maneira incompleta pois seria esforço a toa procurar o título aqui
             $this->arrayBreadCrumb[] = new BreadCrumbInfoVO("", $variable, $value);
             //concatena as veriaveis ja enviadas para fazer a base do link
             //$this->url_final .= "/".$variable.".".$value;
         }
     }
 }
Exemple #8
0
 /**
  * @param $order (str)
  * @return void
  */
 public function setOrder($order)
 {
     $this->order = DataHandler::forceString($order);
 }
Exemple #9
0
 /**
  * serve para buscar um unico item especifico, baseado no id
  * @return ReturnResultVO
  */
 public function get()
 {
     //inicia um retorno de ReturnResultVO
     $ReturnResultVO = new ReturnResultVO();
     $table = DataHandler::forceString($this->ContentInfoPostVO->request_table);
     $table_id = DataHandler::forceInt($this->ContentInfoPostVO->request_table_id);
     $content_id = DataHandler::forceInt($this->ContentInfoPostVO->request_content_id);
     $slug = DataHandler::forceString($this->ContentInfoPostVO->request_slug);
     $locale = DataHandler::forceString($this->ContentInfoPostVO->request_locale);
     $type_of_return = DataHandler::forceString($this->ContentInfoPostVO->request_type_of_return);
     //verifica se foram passados os parametros necessarios para o slect
     if ($table_id > 0 && $slug != NULL) {
         $DAO = ContentDAO::getInstance();
         //se foi passado locale o retorno vai ser em stClassVO
         //se nao o retorno vem em VO para depois buscar os locales
         $ReturnDataVO = $DAO->selectBySlugAndTableId($slug, $table, $table_id, $locale, $type_of_return);
         //print_r($ReturnDataVO);
         //se deu erro retorna
         if (!$ReturnDataVO->success || count($ReturnDataVO->result) <= 0) {
             //deu erro ao vincular
             $ReturnResultVO->success = false;
             $ReturnResultVO->array_messages[] = Translation::text("LibraryLanguage::ERROR_CONTENT_NOT_FOUND");
             return $ReturnResultVO;
         }
         //se foi passado o locale vei pegar os campos com locale
         if ($locale != NULL) {
             //faz o get com locale
             $tempResult = array();
             foreach ($ReturnDataVO->result as $vo) {
                 $tempResult = $vo->toStdClass($locale);
             }
             $ReturnResultVO->success = $ReturnDataVO->success;
             $ReturnResultVO->result = $ReturnDataVO->result;
             return $ReturnResultVO;
         }
         //se estiver tudo certo prepara o retorno no objeto ReturnResultVO
         $ReturnResultVO->success = $ReturnDataVO->success;
         $ReturnResultVO->result = $ReturnDataVO->result;
         return $ReturnResultVO;
     } else {
         //Debug::print_r($this->ContentInfoPostVO);
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->result = array();
         $ReturnResultVO->array_messages[] = Translation::text("LibraryLanguage::ERROR_CONTENT_NOT_FOUND");
         return $ReturnResultVO;
     }
 }
Exemple #10
0
 private function addFilter(&$query, $id, $active, $name, $country_id, $uf)
 {
     if ($id !== NULL) {
         $query .= " AND id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($uf !== NULL) {
         $query .= " AND `uf` = '" . DataHandler::forceString($uf) . "'";
     }
     if ($name !== NULL) {
         $query .= " AND `name` = '" . DataHandler::forceString($name) . "'";
     }
     if ($country_id !== NULL) {
         $query .= " AND `country_id` = '" . DataHandler::forceInt($country_id) . "'";
     }
 }
Exemple #11
0
 /**
  * @param $table
  * @param $table_id
  * @param $name
  * @param $type
  * @param $active
  * @param $locale
  * @param $varchar
  * @param $text
  * @param $number
  * @param $int
  * @param $date
  * @return ReturnDataVO
  */
 public function update($id, $table, $table_id, $name = NULL, $type = ParametherDAO::TYPE_VARCHAR, $active = 1, $locale = NULL, $varchar = NULL, $text = NULL, $number = NULL, $int = NULL, $date = NULL)
 {
     $ReturnDataVO = new ReturnDataVO();
     if ($id == NULL && $id <= 0) {
         $ReturnDataVO->success = FALSE;
         $ReturnDataVO->code_return = DbInterface::ERROR_PARAMETHER_UPDATE_DONOT_HAVE_ID;
         return $ReturnDataVO;
     }
     $query = "UPDATE `paramether` SET ";
     $comma = "";
     if ($active !== NULL) {
         $query .= "{$comma}  `active` = '" . DataHandler::forceInt($active) . "'";
         $comma = ", ";
     }
     if ($table !== NULL) {
         $query .= " {$comma} `table` = '" . DataHandler::forceString($table) . "'";
         $comma = " , ";
     }
     if ($table_id !== NULL) {
         $query .= " {$comma} `table_id` = '" . DataHandler::forceInt($table_id) . "'";
         $comma = " , ";
     }
     if ($name !== NULL) {
         $query .= "{$comma} `name` = '" . DataHandler::forceString($name) . "'";
         $comma = ", ";
     }
     if ($type !== NULL) {
         $query .= " {$comma} `type` = '" . DataHandler::forceString($type) . "'";
         $comma = " , ";
     }
     if ($locale !== NULL) {
         $query .= " {$comma} `locale` = '" . DataHandler::forceString($locale) . "'";
         $comma = ", ";
     }
     if ($varchar !== NULL) {
         $query .= " {$comma} `varchar` = '" . DataHandler::forceString($varchar) . "'";
         $comma = ", ";
     }
     if ($text !== NULL) {
         $query .= " {$comma} `text` = '" . DataHandler::forceString($text) . "'";
         $comma = ", ";
     }
     if ($number !== NULL) {
         $query .= " {$comma} `number` = '" . DataHandler::forceNumber($number) . "'";
         $comma = ", ";
     }
     if ($int !== NULL) {
         $query .= " {$comma} `int` = '" . DataHandler::forceInt($int) . "'";
         $comma = ", ";
     }
     if ($date !== NULL) {
         $query .= " {$comma} `date` = '" . DataHandler::convertDateToDB($date) . "'";
         $comma = ", ";
     }
     $query .= " WHERE id = '" . DataHandler::forceInt($id) . "' LIMIT 1 ";
     //echo $query;
     if ($comma == "") {
         $ReturnDataVO->success = FALSE;
         $ReturnDataVO->code_return = DbInterface::ERROR_PARAMETHER_UPDATE_DONOT_HAVE_UPDATES;
         return $ReturnDataVO;
     } else {
         $ReturnDataVO = parent::query($query);
         if (!$ReturnDataVO->success) {
             $ReturnDataVO->code_return = DbInterface::ERROR_PARAMETHER_UPDATE_COMMIT;
         }
         return $ReturnDataVO;
     }
 }
Exemple #12
0
 static function forceType($valor, $type = "string")
 {
     switch ($type) {
         case "string":
         case "date":
             return DataHandler::forceString($valor);
             break;
         case "number":
             return DataHandler::forceNumber($valor);
             break;
         case "int":
             return DataHandler::forceInt($valor);
             break;
         default:
             return DataHandler::forceString($valor);
             break;
     }
 }
Exemple #13
0
 private function addFilter(&$query, $id = NULL, $address_id = NULL, $name = NULL, $last_name = NULL, $birthday = NULL, $mobile = NULL, $telephone = NULL, $email = NULL, $rg = NULL, $cpf = NULL, $company = NULL, $website = NULL, $sex = NULL, $recive_news = NULL, $registred = NULL, $user_type_id = NULL, $date = NULL, $date_symbol = ">=")
 {
     if ($id !== NULL) {
         $query .= " AND user.id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($name !== NULL) {
         $query .= " AND `name` LIKE '%" . DataHandler::forceString($name) . "%'";
     }
     if ($last_name !== NULL) {
         $query .= " AND `last_name` ='" . DataHandler::forceString($last_name) . "'";
     }
     if ($birthday !== NULL) {
         $query .= " AND `birthday` =" . $this->dateHandlerScape($birthday);
     }
     if ($mobile !== NULL) {
         $query .= " AND `mobile` ='" . DataHandler::forceString($mobile) . "'";
     }
     if ($telephone !== NULL) {
         $query .= " AND `telephone` ='" . DataHandler::forceString($telephone) . "'";
     }
     if ($email !== NULL) {
         $query .= " AND `email` ='" . DataHandler::forceString($email) . "'";
     }
     if ($rg !== NULL) {
         $query .= " AND `rg` ='" . DataHandler::forceString($rg) . "'";
     }
     if ($cpf !== NULL) {
         $query .= " AND `cpf` ='" . DataHandler::forceString($cpf) . "'";
     }
     if ($company !== NULL) {
         $query .= " AND `company` ='" . DataHandler::forceString($company) . "'";
     }
     if ($website !== NULL) {
         $query .= " AND `website` ='" . DataHandler::forceString($website) . "'";
     }
     if ($sex !== NULL) {
         $query .= " AND `sex` ='" . DataHandler::forceInt($sex) . "'";
     }
     if ($recive_news !== NULL) {
         $query .= " AND `recive_news` ='" . DataHandler::forceInt($recive_news) . "'";
     }
     if ($registred !== NULL) {
         $query .= " AND `registred` =" . $this->dateHandlerScape($registred) . "";
     }
     if ($user_type_id != NULL) {
         $query .= " AND `user_type_id` =" . DataHandler::forceInt($user_type_id) . "";
     }
     if ($date !== NULL) {
         $date_symbol = parent::compareSimble($date_symbol);
         $date = parent::dateHandlerScape(DataHandler::convertDateToDB($date));
         $query .= " AND `registred` {$date_symbol} {$date} ";
     }
 }
Exemple #14
0
 /**
  * @param $slug (str)
  * @param $locale
  * @return void
  */
 public function setSlug($slug, $locale = NULL)
 {
     if ($locale == NULL) {
         $this->slug = DataHandler::forceString($slug);
     } else {
         $this->addTherms(CategoryVO::CATEGORY_SLUG, $locale, $slug);
     }
 }
Exemple #15
0
 /**
  * @param $description (str)
  * @param $locale
  * @return void
  */
 public function setDescription($description, $locale = NULL)
 {
     if ($locale == NULL) {
         $this->description = DataHandler::forceString($description);
     } else {
         $this->addComments(CommentVO::TERM_DESCRIPTION, $locale, $description);
     }
 }
Exemple #16
0
 /**
  * @param $content
  * @param $locale
  * @return void
  */
 public function setContent($content, $locale = NULL)
 {
     if ($locale == NULL) {
         $this->content = DataHandler::forceString($content);
     } else {
         $this->addTherms(HighLightsVO::TERM_CONTENT, $locale, $content);
     }
 }
Exemple #17
0
 private function addFilter(&$query, $id, $active, $name, $language_code, $code)
 {
     if ($id !== NULL) {
         $query .= " AND id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($language_code !== NULL) {
         $query .= " AND `language_code` = '" . DataHandler::forceString($language_code) . "'";
     }
     if ($code !== NULL) {
         $query .= " AND `code` = '" . DataHandler::forceString($code) . "'";
     }
     if ($name !== NULL) {
         $query .= " AND `name` = '" . DataHandler::forceString($name) . "'";
     }
 }
 /**
  * @param $File_info_locale
  * @param $File_info_author
  * @param $File_info_active
  * @param $File_info_name
  * @param $File_info_description
  * @param $File_info_order
  * @param $posted_file_data
  * @param $vinculed_table
  * @param $vinculed_table_id
  * @return void
  */
 public function addItem($File_info_locale = NULL, $File_info_author = NULL, $File_info_active = 1, $File_info_name = NULL, $File_info_description = NULL, $File_info_order = NULL, $posted_file_data = NULL, $vinculed_table = NULL, $vinculed_table_id = NULL)
 {
     $FileInfoPostVO = new FileInfoPostVO();
     $FileInfoPostVO->File_info_active = DataHandler::forceInt($File_info_active);
     $FileInfoPostVO->File_info_name = DataHandler::forceString($File_info_name);
     $FileInfoPostVO->File_info_description = DataHandler::forceString($File_info_description);
     $FileInfoPostVO->File_info_order = DataHandler::forceInt($File_info_order);
     $FileInfoPostVO->File_info_locale = $File_info_locale;
     $FileInfoPostVO->File_info_author = DataHandler::forceString($File_info_author);
     //info de id de File, só envie caso a Filem já esteja cadastradas.
     //Caso a Filem já esteja cadastrada, só resta vincular
     $FileInfoPostVO->request_File_id = DataHandler::forceInt($File_id);
     //info de vinculo
     $FileInfoPostVO->table = DataHandler::forceString($vinculed_table);
     $FileInfoPostVO->table_id = DataHandler::forceInt($vinculed_table_id);
     $this->addItemInfoPostVO($FileInfoPostVO);
 }
Exemple #19
0
 /**
  * @param (string)$image_url 
  * @param (string)$locale 
  */
 public function setLink($link, $locale = NULL)
 {
     if ($locale) {
         $this->addTherms(ContentVO::TERM_LINK, $locale, DataHandler::forceString($link));
     }
 }
Exemple #20
0
 /**
  * @param website (str)
  */
 public function setWebsite($website)
 {
     $this->website = DataHandler::forceString($website);
 }
Exemple #21
0
 /**
  * @param $table
  * @param $table_id
  * @param $typeOfReturn
  * @param $quant_limit
  * @param $quant_started
  * @return $ReturnDataVO
  */
 public function selectByTableId($table, $table_id, $typeOfReturn = ContentDAO::RETURN_STD_OBJECT, $quant_limit = NULL, $quant_started = NULL, $active = 1, $search = "", $order_colunm = "order", $order_type = "ASC")
 {
     $search_query = "";
     if ($search != "") {
         $search = DataHandler::forceString($search);
         $search_query = " AND\r\n\t\t\t\t\t\t\t\t(`content`.`title` LIKE '{$search}' OR\r\n\t\t\t\t\t\t\t\t`content`.`content` LIKE '{$search}' \r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t";
     }
     $query = "\r\n\t\t\t\t\t\t\tSELECT \r\n\t\t\t\t\t\t\t\t`content`.*,\r\n\t\t\t\t\t\t\t\t`" . $table . "`.id as " . $table . "_id\r\n\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t  " . $table . "\r\n\t\t\t\t\t\t\tINNER JOIN \r\n\t\t\t\t\t\t\t  `link`\r\n\t\t\t\t\t\t\t ON \r\n\t\t\t\t\t\t\t  `link`.table = '" . $table . "' AND\r\n\t\t\t\t\t\t\t  `link`.linked_table = 'content' AND\r\n\t\t\t\t\t\t\t  `link`.table_id = `" . $table . "`.id AND\r\n\t\t\t\t\t\t\t  `link`.active = " . $active . "\r\n\t\t\t\t\t\t\tINNER JOIN \r\n\t\t\t\t\t\t\t  `content`\r\n\t\t\t\t\t\t\t ON \r\n\t\t\t\t\t\t\t  `content`.id = linked_table_id \r\n\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t  1 AND\r\n\t\t\t\t\t\t\t `" . $table . "`.id = '" . $table_id . "' AND\r\n\t\t\t\t\t\t\t  `" . $table . "`.active = " . $active . "\r\n\t\t\t\t\t\t\t  {$search_query}\r\n\t\t\t\t\t\t\t ORDER BY `link`.{$order_colunm} {$order_type}\r\n\t\t\t\t\t\t";
     $queryCount = "\r\n\t\t\t\t\t\t\tSELECT \r\n\t\t\t\t\t\t\t\tCOUNT(*) AS count\r\n\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t  " . $table . "\r\n\t\t\t\t\t\t\tINNER JOIN \r\n\t\t\t\t\t\t\t  `link`\r\n\t\t\t\t\t\t\t ON \r\n\t\t\t\t\t\t\t  `link`.table = '" . $table . "' AND\r\n\t\t\t\t\t\t\t  `link`.linked_table = 'content' AND\r\n\t\t\t\t\t\t\t  `link`.table_id = `" . $table . "`.id AND\r\n\t\t\t\t\t\t\t  `link`.active = " . $active . "\r\n\t\t\t\t\t\t\tINNER JOIN \r\n\t\t\t\t\t\t\t  `content`\r\n\t\t\t\t\t\t\t ON \r\n\t\t\t\t\t\t\t  `content`.id = linked_table_id \r\n\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t  1 AND\r\n\t\t\t\t\t\t\t `" . $table . "`.id = '" . $table_id . "' AND\r\n\t\t\t\t\t\t\t  `" . $table . "`.active = " . $active . "\r\n\t\t\t\t\t\t\t  {$search_query}\r\n\t\t\t\t\t\t";
     //limite
     $query .= parent::limit($quant_limit, $quant_started);
     //executa a query
     $ReturnDataVO = parent::query($query);
     //echo $query;
     //executa a query para gerar count total
     $ReturnTotalDataVO = parent::query($queryCount);
     if ($ReturnDataVO->success) {
         switch ($typeOfReturn) {
             case DbInterface::RETURN_ARRAY:
                 $ReturnDataVO->fetchAll(ReturnDataVO::TYPE_FETCH_ARRAY);
                 break;
             case DbInterface::RETURN_VO:
                 $ReturnDataVO->fetchAllVO($this);
                 break;
             case DbInterface::RETURN_STD_OBJECT:
             default:
                 //retornar tudo em objeto
                 $ReturnDataVO->fetchAll(ReturnDataVO::TYPE_FETCH_OBJECT);
                 break;
         }
         $ReturnTotalDataVO->fetchAll(ReturnDataVO::TYPE_FETCH_OBJECT);
         $tempTotal = $ReturnTotalDataVO->result[0]->count;
         $ReturnDataVO->count_total = $tempTotal;
         //echo Debug::print_r($ReturnDataVO);
         return $ReturnDataVO;
     } else {
         return $ReturnDataVO;
     }
 }
Exemple #22
0
 /**
  * @param 	string $linked_table
  * @return 	void
  * @coment	Registra a table da unidade vinculada
  */
 public function setLinkedTable($linked_table)
 {
     $this->linked_table = DataHandler::forceString($linked_table);
 }
Exemple #23
0
 private function addFilter(&$query, $id, $active, $table, $table_id, $user_id, $title, $description, $date, $symble_date, $order_type)
 {
     if ($id > 0) {
         $query .= " AND id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($table !== NULL) {
         $query .= " AND `table` = '" . DataHandler::forceString($table) . "'";
     }
     if ($table_id > 0) {
         $query .= " AND `table_id` = '" . DataHandler::forceInt($table_id) . "'";
     }
     if ($user_id > 0) {
         $query .= " AND `user_id` = '" . DataHandler::forceInt($user_id) . "'";
     }
     if ($title !== NULL) {
         $query .= " AND `title` = '" . DataHandler::forceString($title) . "'";
     }
     if ($description !== NULL) {
         $query .= " AND `description` = '" . DataHandler::forceString($description) . "'";
     }
     if ($date !== NULL) {
         $symble_date = parent::compareSimble($symble_date);
         $date = parent::dateHandlerScape($date);
         $query .= " AND `date` {$symble_date} {$date} ";
     }
     //adiciona a ordenação na query
     $orderBy = "";
     if ($order_type != NULL) {
         $order_type = parent::verifyOrderType($order_type);
         $orderBy .= ", `order` " . $order_type;
     }
     if ($orderBy != NULL) {
         $query .= " ORDER BY " . $orderBy;
     }
     $query .= "ORDER BY date DESC";
 }
Exemple #24
0
 /**
  * @param $description (str)
  */
 function setDescription($description)
 {
     $this->description = DataHandler::forceString($description);
 }
Exemple #25
0
 public function setValue($value)
 {
     $this->value = DataHandler::forceString($value);
 }
Exemple #26
0
 private function addFilter(&$query, $id, $active, $name, $link, $content, $image_url, $date, $date_symbol, $date_in, $date_in_symbol, $date_out, $date_out_symbol, $order_type)
 {
     if ($id !== NULL) {
         $query .= " AND id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($name !== NULL) {
         $query .= " AND `name` = '" . DataHandler::forceString($name) . "'";
     }
     if ($link !== NULL) {
         $query .= " AND `link` = '" . DataHandler::forceString($link) . "'";
     }
     if ($content !== NULL) {
         $query .= " AND `content` = '" . DataHandler::forceString($content) . "'";
     }
     if ($image_url !== NULL) {
         $query .= " AND `image_url` = '" . DataHandler::removeSpecialCharacters($image_url) . "'";
     }
     if ($date !== NULL) {
         $date_symbol = parent::compareSimble($date_symbol);
         $date = parent::dateHandlerScape($date);
         $query .= " AND `date` {$date_symbol} {$date} ";
     }
     if ($date_in !== NULL) {
         $date_in_symbol = parent::compareSimble($date_in_symbol);
         $date_in = parent::dateHandlerScape($date_in);
         $query .= " AND `date_in` {$date_in_symbol} {$date_in} ";
     }
     if ($date_out !== NULL) {
         $date_out_symbol = parent::compareSimble($date_out_symbol);
         $date_out = parent::dateHandlerScape($date_out);
         $query .= " AND `date_out` {$date_out_symbol} {$date_out} ";
     }
     //adiciona a ordenação na query
     $orderBy = "";
     if ($order_type != NULL) {
         $order_type = parent::verifyOrderType($order_type);
         $orderBy .= ", `order` " . $order_type;
     }
     if ($orderBy != NULL) {
         $query .= " ORDER BY " . $orderBy;
     }
 }
Exemple #27
0
 public function addFilter(&$query, $id, $active, $email, $date, $date_symbol)
 {
     if ($id !== NULL) {
         $query .= " AND id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($email !== NULL) {
         $query .= " AND `email` = '" . DataHandler::forceString($email) . "'";
     }
     if ($date !== NULL) {
         $date_symbol = parent::compareSimble($date_symbol);
         $date = parent::dateHandlerScape(DataHandler::convertDateToDB($date));
         $query .= " AND `date` {$date_symbol} {$date} ";
     }
 }
Exemple #28
0
 /**
  * @param $email (int)
  * @return void
  */
 public function setEmail($email)
 {
     $this->email = DataHandler::forceString($email);
 }
Exemple #29
0
 /**
  * @param $text (str)
  * @return void
  */
 public function setText($text)
 {
     $this->text = DataHandler::forceString($text);
 }
Exemple #30
0
 private function addFilter(&$query, $id, $active, $user_type_id, $login, $password, $email)
 {
     if ($id !== NULL) {
         $query .= " AND id = '" . DataHandler::forceInt($id) . "'";
     }
     if ($active !== NULL) {
         $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'";
     }
     if ($user_type_id !== NULL) {
         $query .= " AND `user_type_id` = '" . DataHandler::forceInt($user_type_id) . "'";
     }
     if ($login !== NULL) {
         $query .= " AND `login` = '" . DataHandler::forceString($login) . "'";
     }
     if ($password !== NULL) {
         $query .= " AND `password` = '" . DataHandler::forceString($password) . "'";
     }
     if ($email !== NULL) {
         $query .= " AND `email` = '" . DataHandler::forceString($email) . "'";
     }
     //adiciona a ordenação na query
 }