Example #1
0
 /**
  * Test basic adding of strings for table with explicit schema.
  */
 public function testAddStringWithSchemas()
 {
     $table = "mySchema.myTable";
     $column = "myColumn";
     $value = "myValue";
     // Add the string
     $this->c->add($table . '.' . $column, $value);
     // Verify that the key exists
     $this->assertTrue($this->c->containsKey($table . '.' . $column));
     // Verify that what we get out is what we put in
     $this->assertTrue($this->c->getValue($table . '.' . $column) === $value);
 }
Example #2
0
 /**
  * Builds a params array, like the kind populated by Criterion::appendPsTo().
  * This is useful for building an array even when it is not using the appendPsTo() method.
  * @param      array $columns
  * @param      Criteria $values
  * @return     array params array('column' => ..., 'table' => ..., 'value' => ...)
  */
 private static function buildParams($columns, Criteria $values)
 {
     $params = array();
     foreach ($columns as $key) {
         if ($values->containsKey($key)) {
             $crit = $values->getCriterion($key);
             $params[] = array('column' => $crit->getColumn(), 'table' => $crit->getTable(), 'value' => $crit->getValue());
         }
     }
     return $params;
 }