| @@ 225-243 (lines=19) @@ | ||
| 222 | * Set the content topic to use. This will check against the configuration setting |
|
| 223 | * 'symlink_topic'. |
|
| 224 | */ |
|
| 225 | private function _determine_content_topic() |
|
| 226 | { |
|
| 227 | $guid = $this->_config->get('symlink_topic'); |
|
| 228 | if (is_null($guid)) |
|
| 229 | { |
|
| 230 | // No symlink topic |
|
| 231 | // Workaround, we should talk to a DBA object automatically here in fact. |
|
| 232 | $this->_content_topic = midcom_db_topic::get_cached($this->_topic->id); |
|
| 233 | return; |
|
| 234 | } |
|
| 235 | ||
| 236 | $this->_content_topic = midcom_db_topic::get_cached($guid); |
|
| 237 | ||
| 238 | if ($this->_content_topic->component != 'net.nehmer.blog') |
|
| 239 | { |
|
| 240 | debug_print_r('Retrieved topic was:', $this->_content_topic); |
|
| 241 | throw new midcom_error('Symlink content topic is invalid, see the debug level log for details.'); |
|
| 242 | } |
|
| 243 | } |
|
| 244 | ||
| 245 | /** |
|
| 246 | * Indexes an article. |
|
| @@ 54-72 (lines=19) @@ | ||
| 51 | /** |
|
| 52 | * Set the content topic to use. This will check against the configuration setting 'symlink_topic'. |
|
| 53 | */ |
|
| 54 | private function _determine_content_topic() |
|
| 55 | { |
|
| 56 | $guid = $this->_config->get('symlink_topic'); |
|
| 57 | if (is_null($guid)) |
|
| 58 | { |
|
| 59 | // No symlink topic |
|
| 60 | // Workaround, we should talk to a DBA object automatically here in fact. |
|
| 61 | $this->_content_topic = midcom_db_topic::get_cached($this->_topic->id); |
|
| 62 | return; |
|
| 63 | } |
|
| 64 | ||
| 65 | $this->_content_topic = midcom_db_topic::get_cached($guid); |
|
| 66 | // Validate topic. |
|
| 67 | if ($this->_content_topic->component != 'net.nehmer.static') |
|
| 68 | { |
|
| 69 | debug_print_r('Retrieved topic was:', $this->_content_topic); |
|
| 70 | throw new midcom_error('Symlink content topic is invalid, see the debug level log for details.'); |
|
| 71 | } |
|
| 72 | } |
|
| 73 | ||
| 74 | /** |
|
| 75 | * Indexes an article. |
|