-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTableOperation.php
56 lines (43 loc) · 1.13 KB
/
TableOperation.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
<?php
declare(strict_types=1);
/*
* This file is part of the QuidPHP package <https://quidphp.com>
* Author: Pierre-Philippe Emond <emondpph@gmail.com>
* License: https://github.com/quidphp/orm/blob/master/LICENSE
*/
namespace Quid\Orm;
// tableOperation
// abstract class used for a complex operation on a database table
abstract class TableOperation extends Operation
{
// config
protected static array $config = [];
// dynamique
protected Table $table; // conserve la table pour l'opération
// construct
// construit l'objet de l'opération
final public function __construct(Table $table,?array $attr=null)
{
$this->makeAttr($attr);
$this->setTable($table);
}
// setTable
// lie une table à l'objet
final protected function setTable(Table $table):void
{
$this->table = $table;
}
// table
// retourne la table liée à l'opération
final protected function table():Table
{
return $this->table;
}
// db
// retourne la db de l'opération
final public function db():Db
{
return $this->table()->db();
}
}
?>