-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntityJoinable.php
More file actions
57 lines (52 loc) · 1.7 KB
/
Copy pathEntityJoinable.php
File metadata and controls
57 lines (52 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace Bdf\Prime\Query\Contract;
use Closure;
use LogicException;
/**
* Interface for joinEntity() methods
*/
interface EntityJoinable extends Joinable, Whereable
{
/**
* Creates and adds a join to the query.
*
* <code>
* $query
* ->joinEntity('Namespace\\EntityClass', 'userId', 'id', 'entity')
* ->where('entity.name', ':like', 'seb%');
* </code>
*
* @param class-string $entity
* @param string|callable(\Bdf\Prime\Query\JoinClause):void $key
* @param string|null $foreign
* @param string|null $alias Alias is mandatory
* @param Joinable::* $type Type of join.
*
* @return $this This Query instance.
*
* @throws LogicException If alias is not set and $key is not a closure
*/
public function joinEntity(string $entity, $key, ?string $foreign = null, ?string $alias = null, string $type = self::INNER_JOIN);
/**
* Creates and adds a join to the query.
*
* @param class-string $entity
* @param string|callable(\Bdf\Prime\Query\JoinClause):void $key
* @param string|null $foreign
* @param string|null $alias
*
* @return $this This Query instance.
*/
public function leftJoinEntity(string $entity, $key, ?string $foreign = null, ?string $alias = null);
/**
* Creates and adds a join to the query.
*
* @param class-string $entity
* @param string|callable(\Bdf\Prime\Query\JoinClause):void $key
* @param string|null $foreign
* @param string|null $alias
*
* @return $this This Query instance.
*/
public function rightJoinEntity(string $entity, $key, ?string $foreign = null, ?string $alias = null);
}