コード例 #1
0
ファイル: Command.php プロジェクト: Michael-AS/PHP_DB
 public function ExecuteSelectAll($obj)
 {
     try {
         $MontaSelect = new MontaSelect($obj);
         $sql = $MontaSelect->GetSQL(true);
         $retorno = Database::ExecuteQuery($sql);
         $fields = GerenciadorSQL::GetFields($obj, true);
         $props = GerenciadorSQL::GetProperties($obj);
         $reflection = new ReflectionClass($obj);
         return Convert::ToObject($retorno, $fields, $props, $reflection, $obj);
     } catch (Exception $e) {
         $this->ShowException($e);
     }
 }
コード例 #2
0
ファイル: MontaUpdate.php プロジェクト: Michael-AS/PHP_DB
 public function GetSQL()
 {
     try {
         $obj = $this->object;
         $fields = GerenciadorSQL::GetFields($obj, true);
         $values = GerenciadorSQL::GetValues($obj, $fields, true);
         $numf = count($values);
         $sql = null;
         $sql .= "UPDATE " . $obj->GetTableName();
         $sql .= "   SET " . $this->MontaUpdate($numf, $fields, $values);
         $sql .= $this->MontaWherePK($numf, $fields, $values);
         $sql = trim($sql);
         return $sql;
     } catch (Exception $e) {
         $this->ShowException($e);
     }
 }
コード例 #3
0
ファイル: MontaInsert.php プロジェクト: Michael-AS/PHP_DB
 public function GetSQL()
 {
     try {
         $obj = $this->object;
         $fields = GerenciadorSQL::GetFields($obj, true);
         $values = GerenciadorSQL::GetValues($obj, $fields, true);
         $numf = count($values);
         $sql = null;
         $sql .= "INSERT INTO " . $obj->GetTableName();
         $sql .= "(" . $this->MontaFieldsInsert($numf, $fields) . ")";
         $sql .= " VALUES ";
         $sql .= "(" . $this->MontaValuesInsert($numf, $values) . ")";
         $sql = trim($sql);
         return $sql;
     } catch (Exception $e) {
         $this->ShowException($e);
     }
 }
コード例 #4
0
ファイル: MontaSelect.php プロジェクト: Michael-AS/PHP_DB
 public function GetSQL($isList = false)
 {
     try {
         $obj = $this->object;
         $fields = GerenciadorSQL::GetFields($obj, false);
         $values = GerenciadorSQL::GetValues($obj, $fields, false);
         $numf = count($values);
         $sql = null;
         $sql .= "SELECT *\n";
         $sql .= "  FROM " . $obj->GetTableName() . "\n";
         if (!$isList) {
             $sql .= $this->MontaWhere($numf, $fields, $values);
         }
         $sql = trim($sql);
         return $sql;
     } catch (Exception $e) {
         $this->ShowException($e);
     }
 }