Example #1
0
 /**
  * Gets the string form of this criteria
  * @return string with the criteria
  */
 function toString()
 {
     $string = "";
     // Append the table name
     $query = $this->getQuery();
     $className = $query->getClassName();
     $string = "##" . $className . ".";
     // If the programmer tries "equal null", we must look for NULL in a special way
     if ($this->value == null && $this->getType() == Criteria::equalType()) {
         $string = $string . $this->field . " IS NULL";
         return $string;
     }
     if ($this->type == "IN") {
         $value = $this->value;
     } else {
         $value = "'" . $this->value . "'";
     }
     $string = $string . $this->field . " " . $this->type . " " . $value;
     return $string;
 }