- var_dump: documentation ( source)
<?php
$whereClause = "";
$criteria = array("id" => 1, 'tableName' => 'blarg');
foreach($criteria as $key => $value) {
switch($key) {
case 'tableName':
$whereClause .= " WHERE tableName = " . $this->db->qstr($value) . " AND";
break;
case 'id':
$whereClause .= " WHERE id = " . intval($value) . " AND";
break;
case 'translatable':
$whereClause .= " WHERE translatable = " . intval($value) . " AND";
break;
}
}
var_dump($whereClause);