Efficiently\AuthorityController\ControllerResource::getResourceBase PHP Method

getResourceBase() protected method

If the 'through' option is passed it will go through an association on that instance. If the 'shallow' option is passed it will use the getResourceClass() method if there's no parent If the 'singleton' option is passed it won't use the association because it needs to be handled later.
protected getResourceBase ( )
    protected function getResourceBase()
    {
        if (array_key_exists('through', $this->options)) {
            if ($this->getParentResource()) {
                if (array_key_exists('singleton', $this->options)) {
                    return $this->getResourceClass();
                } elseif (array_key_exists('throughAssociation', $this->options)) {
                    $associationName = $this->options['throughAssociation'];
                    return get_classname($this->getParentResource()->{$associationName}()->getModel());
                } else {
                    $associationName = str_plural(camel_case($this->getName()));
                    return get_classname($this->getParentResource()->{$associationName}()->getModel());
                }
            } elseif (array_key_exists('shallow', $this->options)) {
                return $this->getResourceClass();
            } else {
                // Maybe this should be a record not found error instead?
                throw new Exceptions\AccessDenied(null, $this->getAuthorizationAction(), $this->getResourceClass());
            }
        } else {
            return $this->getResourceClass();
        }
    }