Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The function takes an array as a parmater:


keydescriptionexample
tabletable we are selecting from

table' => 'test'

orderbyorder by columns'orderby' => array('c2')
columnscolumns we are interested in'columns' => array('c1','c2')
wherefilter to apply - an array (column, value, operator)'where' => array(array('column' => 'c2', 'value' => 1, 'operator' => '=')

The function returns a results array you can use the phpunit assertEquals fucntion to comapre against an expected result set.

Code Block
languagephp
titlequery function example
$querytable = $this->query(array('columns' => array('property_id', 'idMod'), 'table' => 'properties_modules'));

// example result set
array(0 =>
	array(
		'property_id' => 1,
		'idMod' => 2
	),
	array(
		'property_id' => 2,
		'idMod' => 4
	),
)


If you need to do more and wanted to access the rogo database object all you would have to do is use the $this->db variable.

...