-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModelSingleCollection.php
57 lines (48 loc) · 1.15 KB
/
ModelSingleCollection.php
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 Colibri\Database;
use Colibri\Database;
/**
* ObjectSingleCollection.
*/
class ModelSingleCollection extends ModelCollection
{
/**
* @return \Colibri\Database\Query
*/
protected function query(): Query
{
return Query::select();
}
/**
* @return Query
*/
protected function selFromDbAllQuery(): Query
{
$query = $this->getQuery()->from(static::$itemClass::getTableName());
if ($this->FKValue[1] !== null) {
$query->where([$this->FKName[1] => $this->FKValue[1]]);
}
if ($this->FKValue[0] !== null) {
$query->where([$this->FKName[0] => $this->FKValue[0]]);
}
return $query;
}
// with DataBase
///////////////////////////////////////////////////////////////////////////
/**
* @param \Colibri\Database\Model $id
*/
protected function addToDb(Database\Model &$id)
{
}
/**
* @param mixed $id
*/
protected function delFromDb($id)
{
}
protected function delFromDbAll()
{
}
///////////////////////////////////////////////////////////////////////////
}