protected function _build_conditions($type)
{
$conditions_class_property_name = "_{$type}_conditions";
// If there are no clauses, return empty string
if (count($this->{$conditions_class_property_name}) === 0) {
return '';
}
$conditions = array();
foreach ($this->{$conditions_class_property_name} as $condition) {
$conditions[] = $condition[self::CONDITION_FRAGMENT];
$this->_values = array_merge($this->_values, $condition[self::CONDITION_VALUES]);
}
return strtoupper($type) . " " . join(" AND ", $conditions);
}