@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | } elseif ($name === 'content') { |
49 | 49 | if ($this->dbHandle === null) { |
50 | - throw new \Exception('Document doesnt have a dbHandle handle. (path: ' . $this->path . ')'); |
|
50 | + throw new \Exception('Document doesnt have a dbHandle handle. (path: '.$this->path.')'); |
|
51 | 51 | } else { |
52 | 52 | if ($this->content === null) { |
53 | 53 | $this->getContent(); |
@@ -76,19 +76,19 @@ discard block |
||
76 | 76 | */ |
77 | 77 | protected function getContent() |
78 | 78 | { |
79 | - $folderPathWithWildcard = $this->path . '%'; |
|
79 | + $folderPathWithWildcard = $this->path.'%'; |
|
80 | 80 | $sql = ' SELECT * |
81 | 81 | FROM documents |
82 | - WHERE `path` LIKE ' . $this->dbHandle->quote($folderPathWithWildcard) . ' |
|
83 | - AND substr(`path`, ' . (strlen($this->path) + 2) . ') NOT LIKE "%/%" |
|
84 | - AND substr(`path`, ' . (strlen($this->path) + 1) . ', 1) = "/" |
|
85 | - AND path != ' . $this->dbHandle->quote($this->path) . ' |
|
82 | + WHERE `path` LIKE ' . $this->dbHandle->quote($folderPathWithWildcard).' |
|
83 | + AND substr(`path`, ' . (strlen($this->path) + 2).') NOT LIKE "%/%" |
|
84 | + AND substr(`path`, ' . (strlen($this->path) + 1).', 1) = "/" |
|
85 | + AND path != ' . $this->dbHandle->quote($this->path).' |
|
86 | 86 | '; |
87 | 87 | $stmt = $this->dbHandle->query($sql); |
88 | 88 | if ($stmt === false) { |
89 | 89 | $errorInfo = $this->dbHandle->errorInfo(); |
90 | 90 | $errorMsg = $errorInfo[2]; |
91 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
91 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
92 | 92 | } |
93 | 93 | $contents = $stmt->fetchAll(\PDO::FETCH_CLASS, '\library\storage\Document'); |
94 | 94 | foreach ($contents as $key => $document) { |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function __toString() |
107 | 107 | { |
108 | - return 'Document:' . $this->title; |
|
108 | + return 'Document:'.$this->title; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 |