/** * * @param string $cause name of the class to check for * @return boolean */ public function wasCausedBy($cause) { // if we have no cause, bail if (!$this->hasCause()) { return false; } // if the cause matches, let them know if ($this->cause instanceof $cause) { return true; } // what if the cause is also a symptom? if (method_exists($this->cause, 'wasCausedBy')) { return $this->cause->wasCausedBy($cause); } // if we get here, we have exhausted our possibilities return false; }