Granada\ORM::_build_conditions PHP Method

_build_conditions() protected method

Build a WHERE or HAVING clause
protected _build_conditions ( string $type ) : string
$type string
return string
    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);
    }
ORM