PHP Class Neos\Media\Domain\Model\Image

Inheritance: extends Asset, implements Neos\Media\Domain\Model\ImageInterface, implements Neos\Media\Domain\Model\VariantSupportInterface, use trait DimensionsTrait
Afficher le fichier Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$imageService Neos\Media\Domain\Service\ImageService
$variants Collection<\Neos\Media\Domain\Model\ImageVariant>

Méthodes publiques

Méthode Description
__construct ( PersistentResource $resource ) Constructor
addVariant ( ImageVariant $variant ) : void Adds a variant of this image
getVariants ( ) : array Returns all variants (if any) derived from this asset
initializeObject ( integer $initializationCause ) : void
refresh ( ) : void Calculates image width and height from the image resource.

Méthodes protégées

Méthode Description
calculateDimensionsFromResource ( PersistentResource $resource ) : void Calculates and sets the width and height of this Image asset based on the given PersistentResource.

Method Details

__construct() public méthode

Constructor
public __construct ( PersistentResource $resource )
$resource Neos\Flow\ResourceManagement\PersistentResource

addVariant() public méthode

Note that you should try to re-use variants if you need to adjust them, rather than creating a new variant for every change. Non-used variants will remain in the database and block resource disk space until they are removed explicitly or the original image is deleted.
public addVariant ( ImageVariant $variant ) : void
$variant ImageVariant The new variant
Résultat void

calculateDimensionsFromResource() protected méthode

Calculates and sets the width and height of this Image asset based on the given PersistentResource.
protected calculateDimensionsFromResource ( PersistentResource $resource ) : void
$resource Neos\Flow\ResourceManagement\PersistentResource
Résultat void

getVariants() public méthode

Returns all variants (if any) derived from this asset
public getVariants ( ) : array
Résultat array

initializeObject() public méthode

public initializeObject ( integer $initializationCause ) : void
$initializationCause integer
Résultat void

refresh() public méthode

Calculates image width and height from the image resource.
public refresh ( ) : void
Résultat void

Property Details

$imageService protected_oe property

protected ImageService,Neos\Media\Domain\Service $imageService
Résultat Neos\Media\Domain\Service\ImageService

$variants protected_oe property

protected Collection<\Neos\Media\Domain\Model\ImageVariant> $variants
Résultat Collection<\Neos\Media\Domain\Model\ImageVariant>