ApiPlatform\Core\Metadata\Resource\ResourceMetadata::withAttributes PHP Method

withAttributes() public method

Returns a new instance with the given attribute.
public withAttributes ( array $attributes ) : self
$attributes array
return self
    public function withAttributes(array $attributes) : self
    {
        $metadata = clone $this;
        $metadata->attributes = $attributes;
        return $metadata;
    }