Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Private Attributes | List of all members
eZ\Publish\Core\FieldType\ImageAsset\AssetMapper Class Reference

## Public Member Functions
| __construct (ContentService $contentService, LocationService $locationService, ContentTypeService $contentTypeService, array $mappings)
| createAsset (string $name, ImageValue $image, string $languageCode)
| Creates an Image Asset. More...
| getAssetField (Content $content)
| Returns field which is used to store the Image Asset value from specified content. More...
| getAssetFieldDefinition ()
| Returns definition of the field which is used to store value of the Image Asset. More...
| getAssetValue (Content $content)
| Returns field value of the Image Asset from specified content. More...
| isAsset (Content $content)
| Returns TRUE if content is an Image Asset. More...
| getContentFieldIdentifier ()
| Return identifier of the field used to store Image Asset value. More...
| getParentLocationId ()
| Return ID of the base location for the Image Assets. More...

## Private Attributes
| $contentService
| $locationService
| $contentTypeService
| $mappings = []
| $contentTypeId = null

## Detailed Description

Definition at line 20 of file AssetMapper.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::__construct | ( | ContentService | $contentService,
|  | LocationService | $locationService,
|  | ContentTypeService | $contentTypeService,
|  | array | $mappings
| ) |  |

Parameters

  \eZ\Publish\API\Repository\ContentService | $contentService |
  \eZ\Publish\API\Repository\LocationService | $locationService |
  \eZ\Publish\API\Repository\ContentTypeService | $contentTypeService |
  array | $mappings |

Definition at line 43 of file AssetMapper.php.

References eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\$contentService, eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\$contentTypeService, eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\$locationService, and eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\$mappings.

## Member Function Documentation

## ◆ createAsset()

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::createAsset | ( | string | $name,
|  | ImageValue | $image,
|  | string | $languageCode
| ) |  |

Creates an Image Asset.

Parameters

  string | $name |
  \eZ\Publish\Core\FieldType\Image\Value | $image |
  string | $languageCode |

Returns
  \eZ\Publish\API\Repository\Values\Content\Content

Definition at line 64 of file AssetMapper.php.

## ◆ getAssetField()

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::getAssetField | ( | Content | $content | ) |

Returns field which is used to store the Image Asset value from specified content.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Content | $content |

Returns
  \eZ\Publish\API\Repository\Values\Content\Field

Exceptions

Definition at line 91 of file AssetMapper.php.

References eZ\Publish\API\Repository\Values\Content\Content\getField(), and eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\isAsset().

## ◆ getAssetFieldDefinition()

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::getAssetFieldDefinition | ( |  | ) |

Returns definition of the field which is used to store value of the Image Asset.

Returns
  \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition

Definition at line 105 of file AssetMapper.php.

## ◆ getAssetValue()

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::getAssetValue | ( | Content | $content | ) |

Returns field value of the Image Asset from specified content.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Content | $content |

Returns
  \eZ\Publish\Core\FieldType\Image\Value

Exceptions

Definition at line 126 of file AssetMapper.php.

References eZ\Publish\API\Repository\Values\Content\Content\getFieldValue(), and eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\isAsset().

## ◆ getContentFieldIdentifier()

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::getContentFieldIdentifier | ( |  | ) |

Return identifier of the field used to store Image Asset value.

Returns
  string

Definition at line 162 of file AssetMapper.php.

## ◆ getParentLocationId()

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::getParentLocationId | ( |  | ) |

Return ID of the base location for the Image Assets.

Returns
  int

Definition at line 172 of file AssetMapper.php.

## ◆ isAsset()

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::isAsset | ( | Content | $content | ) |

Returns TRUE if content is an Image Asset.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Content | $content |

Returns
  bool

Exceptions

Definition at line 144 of file AssetMapper.php.

References eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\$contentTypeId.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\getAssetField(), and eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\getAssetValue().

## Member Data Documentation

## ◆ $contentService

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::$contentService
| private

Definition at line 23 of file AssetMapper.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\__construct().

## ◆ $contentTypeId

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::$contentTypeId = null
| private

Definition at line 35 of file AssetMapper.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\isAsset().

## ◆ $contentTypeService

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::$contentTypeService
| private

Definition at line 29 of file AssetMapper.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\__construct().

## ◆ $locationService

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::$locationService
| private

Definition at line 26 of file AssetMapper.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\__construct().

## ◆ $mappings

eZ\Publish\Core\FieldType\ImageAsset\AssetMapper::$mappings = []
| private

Definition at line 32 of file AssetMapper.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\AssetMapper\__construct().

The documentation for this class was generated from the following file:

- AssetMapper.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.