Example #1
0
 /**
  * accepts a finalised sql statement and prepares SQL for DATABASE
  * 
  * @param string $sql
  * @param boolean $void set whether or not the statement is
  * an insert, update, delete or typical select statement,
  * i.e. select * from dual
  * 
  * @return the class object
  */
 public function __compiled_str($sql, $void = false)
 {
     $this->__setIsVoid();
     if (is_bool($void)) {
         if (!$void) {
             if (DATABASE::startswith(strtoupper($sql), "SELECT")) {
                 $this->__setIsSelect();
             }
             if (DATABASE::startswith(strtoupper($sql), "UPDATE")) {
                 $this->__setIsUpdate();
             }
             if (DATABASE::startswith(strtoupper($sql), "DELETE")) {
                 $this->__setIsDelete();
             }
             if (DATABASE::startswith(strtoupper($sql), "INSERT")) {
                 $this->__setIsInsert();
             }
         }
     } elseif (is_int($void)) {
         if ($void === DATABASE::ALL) {
             $this->__setIsSelect();
         }
         if ($void === DATABASE::UPD) {
             $this->__setIsUpdate();
         }
         if ($void === DATABASE::DEL) {
             $this->__setIsDelete();
         }
         if ($void === DATABASE::INS) {
             $this->__setIsInsert();
         }
     }
     $this->__statement__ = $sql;
     $this->__fix_where();
     return $this;
 }