1: <?php
2:
3: namespace PHPixie\Database\Driver\Mongo\Query\Type;
4:
5: class Update extends \PHPixie\Database\Driver\Mongo\Query\Items
6: implements \PHPixie\Database\Query\Type\Update\Incrementable,
7: \PHPixie\Database\Query\Type\Update\Unsetable
8: {
9:
10: public function __construct($connection, $parser, $builder)
11: {
12: parent::__construct($connection, $parser, $builder);
13:
14: $this->aliases = array_merge($this->aliases, array(
15: 'unset' => '_unset',
16: ));
17: }
18:
19: public function type()
20: {
21: return 'update';
22: }
23:
24: public function set($keys)
25: {
26: $this->builder->addSet(func_get_args());
27:
28: return $this;
29: }
30:
31: public function clearSet()
32: {
33: $this->builder->clearArray('set');
34:
35: return $this;
36: }
37:
38: public function getSet()
39: {
40: return $this->builder->getArray('set');
41: }
42:
43: public function _unset($keys)
44: {
45: $this->builder->addUnset(func_get_args());
46:
47: return $this;
48: }
49:
50: public function clearUnset()
51: {
52: $this->builder->clearArray('unset');
53:
54: return $this;
55: }
56:
57: public function getUnset()
58: {
59: return $this->builder->getArray('unset');
60: }
61:
62: public function increment($increments)
63: {
64: $this->builder->addIncrement(func_get_args());
65:
66: return $this;
67: }
68:
69: public function clearIncrement()
70: {
71: $this->builder->clearArray('increment');
72:
73: return $this;
74: }
75:
76: public function getIncrement()
77: {
78: return $this->builder->getArray('increment');
79: }
80: }
81: