| @@ 166-187 (lines=22) @@ | ||
| 163 | unlink('jpemeric_blog.db'); |
|
| 164 | } |
|
| 165 | ||
| 166 | protected function insertPostData(array $data) |
|
| 167 | { |
|
| 168 | $defaultData = [ |
|
| 169 | 'id' => null, |
|
| 170 | 'title' => '', |
|
| 171 | 'path' => '', |
|
| 172 | 'category' => '', |
|
| 173 | 'date' => '', |
|
| 174 | 'body' => '', |
|
| 175 | 'display' => 0, |
|
| 176 | ]; |
|
| 177 | ||
| 178 | $data = array_merge($defaultData, $data); |
|
| 179 | ||
| 180 | return self::$connection->getDefault()->perform(" |
|
| 181 | INSERT INTO `jpemeric_blog`.`post` |
|
| 182 | (id, title, path, category, date, body, display) |
|
| 183 | VALUES |
|
| 184 | (:id, :title, :path, :category, :date, :body, :display)", |
|
| 185 | $data |
|
| 186 | ); |
|
| 187 | } |
|
| 188 | ||
| 189 | protected function insertSeriesData(array $data) |
|
| 190 | { |
|
| @@ 433-454 (lines=22) @@ | ||
| 430 | unlink('jpemeric_stream.db'); |
|
| 431 | } |
|
| 432 | ||
| 433 | protected function insertData(array $data) |
|
| 434 | { |
|
| 435 | $defaultData = [ |
|
| 436 | 'id' => null, |
|
| 437 | 'message' => '', |
|
| 438 | 'message_long' => '', |
|
| 439 | 'datetime' => '', |
|
| 440 | 'metadata' => '', |
|
| 441 | 'type' => '', |
|
| 442 | 'type_id' => '', |
|
| 443 | ]; |
|
| 444 | ||
| 445 | $data = array_merge($defaultData, $data); |
|
| 446 | ||
| 447 | return self::$connection->getDefault()->perform(" |
|
| 448 | INSERT INTO `jpemeric_stream`.`activity` |
|
| 449 | (id, message, message_long, datetime, metadata, type, type_id) |
|
| 450 | VALUES |
|
| 451 | (:id, :message, :message_long, :datetime, :metadata, :type, :type_id)", |
|
| 452 | $data |
|
| 453 | ); |
|
| 454 | } |
|
| 455 | } |
|
| 456 | ||