protected function retrieveOrException($attrName, $methodName = "this method", $reason = "")
    {

        if (property_exists($this, $attrName) === false) {
            throw new \Exception("Property $attrName not found in class.");
        }

        if ($this->$attrName === null) {
            $message = $reason !== "" ? "Because you $reason, " : "You ";
            $message .= "must set $attrName for this object before calling $methodName.";

            throw new \Exception($message);
        }

        return $this->$attrName;
    }