| @@ 234-246 (lines=13) @@ | ||
| 231 | * Validate path filter |
|
| 232 | * @return bool |
|
| 233 | */ |
|
| 234 | public function validatePath() |
|
| 235 | { |
|
| 236 | // try to find this item |
|
| 237 | $find = Content::where('path', '=', $this->path); |
|
| 238 | // exclude self id |
|
| 239 | if ($this->_content->id !== null && Obj::isLikeInt($this->_content->id)) { |
|
| 240 | $find->where('id', '!=', $this->_content->id); |
|
| 241 | } |
|
| 242 | // limit only current category id |
|
| 243 | $find->where('category_id', '=', $this->categoryId); |
|
| 244 | ||
| 245 | return $find->count() < 1; |
|
| 246 | } |
|
| 247 | ||
| 248 | /** |
|
| 249 | * Generate random string for comment hash value |
|
| @@ 209-222 (lines=14) @@ | ||
| 206 | * Validate content item pathway |
|
| 207 | * @return bool |
|
| 208 | */ |
|
| 209 | public function validatePath() |
|
| 210 | { |
|
| 211 | // try to find this item |
|
| 212 | $find = Content::where('path', '=', $this->path); |
|
| 213 | // exclude self id |
|
| 214 | if ($this->_record->id !== null && Obj::isLikeInt($this->_record->id)) { |
|
| 215 | $find->where('id', '!=', $this->_record->id); |
|
| 216 | } |
|
| 217 | ||
| 218 | // limit only current category id |
|
| 219 | $find->where('category_id', '=', $this->categoryId); |
|
| 220 | ||
| 221 | return $find->count() < 1; |
|
| 222 | } |
|
| 223 | ||
| 224 | /** |
|
| 225 | * Generate random string for comment hash value |
|