ApiPlatform\Core\Metadata\Extractor\YamlExtractor::extractProperties PHP Метод

extractProperties() приватный Метод

private extractProperties ( array $resourceYaml, string $resourceName, string $path )
$resourceYaml array
$resourceName string
$path string
    private function extractProperties(array $resourceYaml, string $resourceName, string $path)
    {
        foreach ($resourceYaml['properties'] as $propertyName => $propertyValues) {
            if (null === $propertyValues) {
                $this->resources[$resourceName]['properties'][$propertyName] = null;
                continue;
            }
            if (!is_array($propertyValues)) {
                throw new InvalidArgumentException(sprintf('"%s" setting is expected to be null or an array, %s given in "%s".', $propertyName, gettype($propertyValues), $path));
            }
            $this->resources[$resourceName]['properties'][$propertyName] = ['description' => $this->phpize($propertyValues, 'description', 'string'), 'readable' => $this->phpize($propertyValues, 'readable', 'bool'), 'writable' => $this->phpize($propertyValues, 'writable', 'bool'), 'readableLink' => $this->phpize($propertyValues, 'readableLink', 'bool'), 'writableLink' => $this->phpize($propertyValues, 'writableLink', 'bool'), 'required' => $this->phpize($propertyValues, 'required', 'bool'), 'identifier' => $this->phpize($propertyValues, 'identifier', 'bool'), 'iri' => $this->phpize($propertyValues, 'iri', 'string'), 'attributes' => $propertyValues['attributes'] ?? null];
        }
    }