| @@ 71-81 (lines=11) @@ | ||
| 68 | * | |
| 69 | * @throws LogicException | |
| 70 | */ | |
| 71 | public function delete() | |
| 72 |     { | |
| 73 |         if (!isset($this->table)) { | |
| 74 |             throw new LogicException("delete() called before table()"); | |
| 75 | } | |
| 76 | ||
| 77 | $query = $this->factory->newDelete(); | |
| 78 | $query->from($this->table); | |
| 79 | ||
| 80 |         return $this->cloneWith("query", $query); | |
| 81 | } | |
| 82 | ||
| 83 | /** | |
| 84 | * @param array $data | |
| @@ 90-101 (lines=12) @@ | ||
| 87 | * | |
| 88 | * @throws LogicException | |
| 89 | */ | |
| 90 | public function insert(array $data) | |
| 91 |     { | |
| 92 |         if (!isset($this->table)) { | |
| 93 |             throw new LogicException("insert() called before table()"); | |
| 94 | } | |
| 95 | ||
| 96 | $query = $this->factory->newInsert(); | |
| 97 | $query->into($this->table); | |
| 98 | $query->cols($data); | |
| 99 | ||
| 100 |         return $this->cloneWith("query", $query); | |
| 101 | } | |
| 102 | ||
| 103 | /** | |
| 104 | * @param int $limit | |
| @@ 207-218 (lines=12) @@ | ||
| 204 | * | |
| 205 | * @throws LogicException | |
| 206 | */ | |
| 207 | public function update(array $data) | |
| 208 |     { | |
| 209 |         if (!isset($this->table)) { | |
| 210 |             throw new LogicException("update() called before table()"); | |
| 211 | } | |
| 212 | ||
| 213 | $query = $this->factory->newUpdate(); | |
| 214 | $query->table($this->table); | |
| 215 | $query->cols($data); | |
| 216 | ||
| 217 |         return $this->cloneWith("query", $query); | |
| 218 | } | |
| 219 | ||
| 220 | /** | |
| 221 | * @param mixed $where | |