src/filter/FilterBuilder.php
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;
    }
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;
    }
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 ; }
If it has been set, retrieve the indicated property from this builder. If not, throw exception.

@param string $attrName   The name of the attribute to retrieve, including underscore.
@param string $methodName The name of the calling method, optional.
@param string $reason     An optional, additional "reason" to display with the exception.
@return mixed The indicated attribute, if set.
@throws \Exception If the indicated attribute has not been set, or if the attribute does not exist.
If it has been set retrieve the indicated property from this builder . If not throw exception .