Skip to content

Volumes ​

Type
Class
Namespace
craft\mcp\capabilities
Inherits
craft\mcp\capabilities\Volumes
Since
5.12.0

View source

Public Methods ​

MethodDescription
__construct()
create()
delete()
get()
list()
update()

__construct() ​

View source

Arguments ​

  • $fieldLayouts
  • $volumes

create() ​

View source

Arguments ​

  • $name (string) – Volume name.
  • $handle
  • $fsHandle (string) – Registered Craft filesystem handle.
  • $subpath (string, null) – Asset subpath within the disk.
  • $titleTranslationMethod (string) – Asset title translation method.
  • $titleTranslationKeyFormat (string, null) – Custom asset title translation key format.
  • $altTranslationMethod (string) – Asset alternative-text translation method.
  • $altTranslationKeyFormat (string, null) – Custom asset alternative-text translation key format.
  • $fieldLayout (array<string,mixed>, null) – Native Craft field layout config.

Returns ​

array{volume: array<string,mixed>}

delete() ​

View source

Arguments ​

  • $id
  • $uid
  • $handle

Returns ​

array{deleted: true}

get() ​

View source

Arguments ​

  • $id
  • $uid
  • $handle

Returns ​

array{volume: array<string,mixed>}

list() ​

View source

Returns ​

array{count: int, volumes: list<array<string,mixed>>}

update() ​

View source

Arguments ​

  • $context
  • $id
  • $uid
  • $currentHandle (string, null) – Existing volume handle.
  • $name (string, null) – Volume name.
  • $handle (string, null) – New volume handle.
  • $fsHandle (string, null) – Registered Craft filesystem handle.
  • $subpath (string, null) – Asset subpath within the disk.
  • $titleTranslationMethod (string) – Asset title translation method.
  • $titleTranslationKeyFormat (string, null) – Custom asset title translation key format.
  • $altTranslationMethod (string) – Asset alternative-text translation method.
  • $altTranslationKeyFormat (string, null) – Custom asset alternative-text translation key format.
  • $fieldLayout (array<string,mixed>, null) – Native Craft field layout config.

Returns ​

array{volume: array<string,mixed>}