public static function formatConditions($methondname, $conditions)
    {
        if (count($conditions) > 1) {
            throw new InvalidArgumentException(
                sprintf("Method '%s' supports a single array input", $methondname)
            );
        }

        if (1 == count($conditions)) {
            if ($conditions[0] instanceof Node) {
                return $conditions;
            }
        }

        $conditions = (empty($conditions)) ? [[]] : $conditions;

        return call_user_func_array('array_merge', $conditions);
    }
public static function formatConditions($methondname, $conditions)
    {
        if (count($conditions) > 1) {
            throw new InvalidArgumentException(
                sprintf("Method '%s' supports a single array input", $methondname)
            );
        }

        if (1 == count($conditions)) {
            if ($conditions[0] instanceof Node) {
                return $conditions;
            }
        }

        $conditions = (empty($conditions)) ? [[]] : $conditions;

        return call_user_func_array('array_merge', $conditions);
    }
public static function formatConditions ( $ methondname , $ conditions ) { if ( count ( $ conditions ) > 1 ) { throw new InvalidArgumentException ( sprintf ( "Method '%s' supports a single array input" , $ methondname ) ) ; } if ( 1 == count ( $ conditions ) ) { if ( $ conditions [ 0 ] instanceof Node ) { return $ conditions ; } } $ conditions = ( empty ( $ conditions ) ) ? [ [ ] ] : $ conditions ; return call_user_func_array ( 'array_merge' , $ conditions ) ; }
Ensure the conditions passed in are ready to used to perform query operations.

@param $methondname
@param $conditions

@return mixed

@throws InvalidArgumentException

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
Ensure the conditions passed in are ready to used to perform query operations .