whereHas method

Query<T> whereHas(
  1. String relationPath, [
  2. void callback(
    1. Query q
    )?
])

Implementation

Query<T> whereHas(
  String relationPath,
  [void Function(Query<dynamic> q)? callback]
) {
  final List<dynamic> collectedParams = [];

  final sql = _buildExists(
    relationPath.split('.'),
    model,
    model.table,
    callback,
    collectedParams,
  );

  base.addWhere(sql, collectedParams);
  return this;
}