| @@ 216-228 (lines=13) @@ | ||
| 213 | * Validate path filter |
|
| 214 | * @return bool |
|
| 215 | */ |
|
| 216 | public function validatePath() |
|
| 217 | { |
|
| 218 | // try to find this item |
|
| 219 | $find = Content::where('path', '=', $this->path); |
|
| 220 | // exclude self id |
|
| 221 | if ($this->_content->id !== null && Obj::isLikeInt($this->_content->id)) { |
|
| 222 | $find->where('id', '!=', $this->_content->id); |
|
| 223 | } |
|
| 224 | // limit only current category id |
|
| 225 | $find->where('category_id', '=', $this->categoryId); |
|
| 226 | ||
| 227 | return $find->count() < 1; |
|
| 228 | } |
|
| 229 | ||
| 230 | /** |
|
| 231 | * Generate random string for comment hash value |
|
| @@ 195-208 (lines=14) @@ | ||
| 192 | return $response; |
|
| 193 | } |
|
| 194 | ||
| 195 | public function validatePath() |
|
| 196 | { |
|
| 197 | // try to find this item |
|
| 198 | $find = Content::where('path', '=', $this->path); |
|
| 199 | // exclude self id |
|
| 200 | if ($this->_record->id !== null && Obj::isLikeInt($this->_record->id)) { |
|
| 201 | $find->where('id', '!=', $this->_record->id); |
|
| 202 | } |
|
| 203 | ||
| 204 | // limit only current category id |
|
| 205 | $find->where('category_id', '=', $this->categoryId); |
|
| 206 | ||
| 207 | return $find->count() < 1; |
|
| 208 | } |
|
| 209 | ||
| 210 | /** |
|
| 211 | * Generate random string for comment hash value |
|