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); } }