protected function getResourceAttribute($name, $resourceOwner)
    {
        // Call resource owner getter first
        $method = "get" . $name;

        if (is_callable(array($resourceOwner, $method))) {
            $res = $resourceOwner->$method();
            return $res;
        } else {
            $resourceArray = $resourceOwner->toArray();
            $res = $this->getValueByKey($resourceArray, $name);
            return $res;
        }
    }