Example #1
0
 /**
  * @return	string
  */
 public function buildSql()
 {
     $indexName = $this->getIndexName();
     $sqlValue = "({$this->buildColumnString()})";
     if (!empty($indexName)) {
         $sqlValue = "{$indexName} {$sqlValue}";
     }
     $sqlValue = strtolower($sqlValue);
     if ($this->isUpperCase()) {
         $sqlValue = strtoupper($sqlValue);
     }
     return parent::buildSql() . " {$sqlValue}";
 }
Example #2
0
 /**
  * @return	string
  */
 public function buildSql()
 {
     $value = $this->getValue();
     if (is_numeric($value)) {
         $sqlValue = $value;
     } else {
         if (is_string($value) || is_object($value)) {
             $sqlValue = "'{$value}'";
         } else {
             if (null === $value) {
                 $sqlValue = 'null';
                 /* 
                  * this only makes sense for the null keyword
                  */
                 if ($this->isUpperCase()) {
                     $sqlValue = strtoupper($sqlValue);
                 }
             }
         }
     }
     return parent::buildSql() . ' ' . $sqlValue;
 }