Mark V
1: <?php
2: namespace MOC\V\Component\Database\Component\Bridge;
3:
4: use MOC\V\Component\Database\Component\IBridgeInterface;
5:
6: /**
7: * Class Bridge
8: *
9: * @package MOC\V\Component\Database\Component\Bridge
10: */
11: abstract class Bridge implements IBridgeInterface
12: {
13:
14: /** @var array $StatementList */
15: protected static $StatementList = array();
16:
17: /** @var array $ParameterList */
18: protected static $ParameterList = array();
19:
20: /**
21: * Example: SELECT * FROM example WHERE id = ? AND name = ?
22: *
23: * @param string $Sql
24: *
25: * @return IBridgeInterface
26: */
27: final public function prepareStatement($Sql)
28: {
29:
30: if (is_array($Sql)) {
31: static::$StatementList += $Sql;
32: } else {
33: array_push(static::$StatementList, $Sql);
34: }
35: return $this;
36: }
37:
38: /**
39: * @param mixed $Value
40: * @param null|int $Type
41: *
42: * @return IBridgeInterface
43: */
44: final public function defineParameter($Value, $Type = null)
45: {
46:
47: array_push(static::$ParameterList, array($Value, $Type));
48: return $this;
49: }
50: }
51: