You may accept `$criteria = null` and call `createCriteria()` only if it is an array.