AssetAdapter ​
- Type
- Class
- Namespace
- craft\mcp\elements\adapters
- Inherits
- craft\mcp\elements\adapters\AssetAdapter » craft\mcp\elements\BaseElementAdapter
- Implements
- craft\mcp\elements\ElementAdapter
- Since
- 5.12.0
Protected Properties ​
| Property | Description |
|---|---|
| elementSerializer | |
| lifecycle |
Public Methods ​
| Method | Description |
|---|---|
| __construct() | |
| authorizeAssetSave() | Checks that the actor may save the asset. |
| canDelete() | |
| canView() | |
| create() | |
| createUnpublishedDraft() | |
| duplicate() | |
| elementType() | |
| fieldSchemaElement() | |
| find() | |
| handle() | |
| listQuery() | |
| prepareValidation() | |
| schema() | |
| serialize() | |
| targetFolder() | Resolves an upload destination from exactly one of a folder ID or a volume ID. |
| update() |
__construct() ​
Arguments ​
$elementSerializer$lifecycle$assets$folders
authorizeAssetSave() ​
Checks that the actor may save the asset.
Arguments ​
$actor$asset
create() ​
Arguments ​
$attributes$fields$actor
elementType() ​
fieldSchemaElement() ​
Arguments ​
$element(craft\elements\Asset, null)$context$actor
handle() ​
prepareValidation() ​
Arguments ​
$element(craft\elements\Asset)$attributes$fields$actor
targetFolder() ​
Resolves an upload destination from exactly one of a folder ID or a volume ID.
Arguments ​
$folderId$volumeId
update() ​
Arguments ​
$element(craft\elements\Asset)$attributes$fields$actor
Protected Methods ​
| Method | Description |
|---|---|
| authorizeSave() | |
| createAttributesSchema() | Returns the JSON Schema for attributes elements.create accepts, or null if it cannot create this type. |
| criteriaProperties() | |
| duplicateModes() | |
| fieldSchemaContextSchema() | |
| findQuery() | Returns the query find() loads an element with. |
| newElement() | Returns a new, unsaved element. |
| notes() | |
| populate() | Applies validated attributes and custom field values to an element. |
| prepareCreate() | Returns a new element populated with the given values, after authorizing the actor to save it. |
| save() | |
| saveElement() | Saves an element as the acting user and returns the saved element, which may be a new draft. |
| saveFailed() | |
| setFieldValues() | Sets custom field values given in the format elements.field-schema describes. |
| updateAttributesSchema() |