Exemplo n.º 1
0
Arquivo: TXT.php Projeto: elemenofi/lb
 public static function WHERE___BIND__Params($SP, $ArrayObject, $Extra__Column__Name = null, $Extra__Column__Value = null)
 {
     $Query = " WHERE ";
     $Columns = array_keys((array) $ArrayObject);
     foreach ($Columns as $Column__Name) {
         $Query .= ccTXT__DB::WHERE___GET__Clause($Column__Name) . " AND ";
     }
     if ($Extra__Column__Name === null) {
         $Query = substr($Query, strlen($Query) - 4);
     } else {
         $Query .= ccTXT__DB::WHERE___GET__Param_Name($Extra__Column__Name);
     }
     return $Query;
 }
Exemplo n.º 2
0
 private function CHECK___iRow_vs_Value($iRow, $Name = null, $Value = null)
 {
     /* @var $Row ccRow */
     $Row = clone $this->Rows[$iRow];
     unset($Row->Id);
     $Query = "SELECT Id FROM lbxxdb50.db__" . strtolower($this->Name);
     $Query .= ccTXT__DB::WHERE___GET__Query($Row, $Name) . ";";
     global $PDO;
     $SP = $PDO->prepare($Query);
     foreach ($Row as $Column__Name => $Column) {
         foreach ($Column as $Cell) {
             $Param_Name = ccTXT__DB::WHERE___GET__Param_Name($Column__Name);
             $Param_Type = ccTXT__DB::WHERE___GET__Param_Type($Cell->Value);
             $SP->bindValue($Param_Name, $Cell->Value, $Param_Type);
         }
     }
     if ($Name !== null) {
         $Param_Name = ccTXT__DB::WHERE___GET__Param_Name($Name);
         $Param_Type = ccTXT__DB::WHERE___GET__Param_Type($Value);
         $SP->bindValue($Param_Name, $Value, $Param_Type);
     }
     $ResultsSets = ccDB::GET__ResultsSets__Merged($SP);
     if ($ResultsSets[0][Id] !== null) {
         return (int) $ResultsSets[0][Id];
     }
 }