Ouzo\Db\Dialect\DialectUtil::buildWhereQuery PHP Method

buildWhereQuery() public static method

public static buildWhereQuery ( $whereClauses )
    public static function buildWhereQuery($whereClauses)
    {
        $parts = FluentArray::from($whereClauses)->filter(WhereClause::isNotEmptyFunction())->map('\\Ouzo\\Db\\Dialect\\DialectUtil::buildWhereQueryPart')->toArray();
        return implode(' AND ', Arrays::filterNotBlank($parts));
    }

Usage Example

Example #1
0
 protected function _where($whereClauses)
 {
     $where = DialectUtil::buildWhereQuery($whereClauses);
     if ($where) {
         return ' WHERE ' . $where;
     }
     return '';
 }