public function __construct($daoObject, $queryAction, DbQueryFilters $filters) { $this->setDaoObject($daoObject); $this->setDaoClassName(\Puzzlout\Framework\Helpers\CommonHelper::GetFullClassName($daoObject)); $this->setTableName(\Puzzlout\Framework\Helpers\CommonHelper::GetShortClassName($daoObject)); $this->setType($queryAction); //$this->BuildSelectClause((array) $daoObject); //$this->BuildWhereClause($filters->whereFilters()); $this->setFilters($filters); }
/** * * @param type $object * @param type $where_filters * @return type */ public function selectManyComplex($object, $where_filters) { $this->dbConfig()->setType(DbExecutionType::SELECT); $this->dbConfig()->setDaoClassName(\Puzzlout\Framework\Helpers\CommonHelper::GetFullClassName($object)); $select_clause = "SELECT "; //TODO: implement building the where clause with one or many filters $where_clause = ""; //$this->BuildWhereClause($where_filters); foreach ($object as $key => $value) { $select_clause .= $key . ", "; } $select_clause = rtrim($select_clause, ", "); $select_clause .= " FROM " . $this->GetTableName($object); $order_by = ""; if ($object->getOrderByField() !== false) { $order_by = "ORDER BY " . $object->getOrderByField(); } $select_clause .= $where_clause . " " . $order_by; $sth = $this->dao->prepare($select_clause); return $this->ExecuteQuery($sth, $params); }