Repository navigation
JoinClause
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Orm\JoinClause builds complex JOIN ... ON ... conditions for Query.
$join = new \Pair\Orm\JoinClause('left', 'users u');on(string $first, string $operator, string $second, string $boolean = 'and')orOn(string $first, string $operator, string $second)
where(string $column, mixed $operator = null, mixed $value = null, string $boolean = 'and')orWhere(...)whereIn(string $column, array $values, string $boolean = 'and', bool $not = false)-
whereNotIn(...),orWhereIn(...),orWhereNotIn(...) whereNull(string $column, string $boolean = 'and', bool $not = false)-
whereNotNull(...),orWhereNull(...),orWhereNotNull(...) whereRaw(string $sql, array $bindings = [], string $boolean = 'and')orWhereRaw(...)
getClauses(): arraygetBindings(): array
use Pair\Orm\Query;
$rows = Query::table('orders o')
->leftJoin('users u', function ($join) {
$join->on('u.id', '=', 'o.user_id')
->where('u.active', 1)
->whereNotNull('u.email')
->orWhereIn('u.role', ['admin', 'manager']);
})
->select('o.id', 'u.email')
->get();This allows expressive join conditions without raw SQL for most cases.
See also: Query, QueryGrammar, Database.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4