NilPortugues\Laravel5\JsonApi\Providers\Laravel51Provider::setUrlWithReflection PHP Method

setUrlWithReflection() protected method

protected setUrlWithReflection ( NilPortugues\Api\Mapping\Mapping $mapping, ReflectionClass $mappingClass, string $property )
$mapping NilPortugues\Api\Mapping\Mapping
$mappingClass ReflectionClass
$property string
    protected function setUrlWithReflection(Mapping $mapping, ReflectionClass $mappingClass, $property)
    {
        $mappingProperty = $mappingClass->getProperty($property);
        $mappingProperty->setAccessible(true);
        $value = $mappingProperty->getValue($mapping);
        if (!empty($value['name'])) {
            $route = $this->calculateRoute($value);
            $mappingProperty->setValue($mapping, $route);
        }
    }