public function create(string $resourceClass, string $property, array $options = []) : PropertyMetadata
{
$parentPropertyMetadata = null;
if ($this->decorated) {
try {
$parentPropertyMetadata = $this->decorated->create($resourceClass, $property, $options);
} catch (PropertyNotFoundException $propertyNotFoundException) {
// Ignore not found exception from decorated factories
}
}
if (!property_exists($resourceClass, $property) || !($propertyMetadata = $this->extractor->getResources()[$resourceClass]['properties'][$property] ?? false)) {
return $this->handleNotFound($parentPropertyMetadata, $resourceClass, $property);
}
if ($parentPropertyMetadata) {
return $this->update($parentPropertyMetadata, $propertyMetadata);
}
return new PropertyMetadata(null, $propertyMetadata['description'], $propertyMetadata['readable'], $propertyMetadata['writable'], $propertyMetadata['readableLink'], $propertyMetadata['writableLink'], $propertyMetadata['required'], $propertyMetadata['identifier'], $propertyMetadata['iri'], null, $propertyMetadata['attributes']);
}