12345678910111213141516171819 |
- <?php
-
- namespace Blog\DB;
-
- use Blog\Model\Blog as BlogModel;
-
- class Blog extends DB
- {
- public function createBlog(BlogModel $data)
- {
- $this->enableExceptions(false);
- $stmt = $this->prepare("INSERT INTO blogs (slug, title, content) VALUES (:slug, :title, :content)");
- $stmt->bindValue(':slug', $data['slug'], SQLITE3_TEXT);
- $stmt->bindValue(':title', $data['title'], SQLITE3_TEXT);
- $stmt->bindValue(':content', $data['content'], SQLITE3_TEXT);
- $res = $stmt->execute();
- return $res;
- }
- }
|