- if (is_int($this->_original) && $this->_original == -1) {
- if (empty($this->reply_to)) {
- $this->_original = null;
- } else {
- $this->_original = Notice::getKV('id', $this->reply_to);
- }
+ if (empty($this->reply_to)) {
+ // Should this also be NoResultException? I don't think so.
+ throw new Exception('Notice has no parent');
+ } elseif ($this->_parent === -1) { // local object cache
+ $this->_parent = Notice::getKV('id', $this->reply_to);
+ }
+
+ if (!($this->_parent instanceof Notice)) {
+ throw new NoResultException($this->_parent);