PHP 클래스 Neos\Media\Domain\Model\ImageVariant

상속: extends Asset, implements Neos\Media\Domain\Model\AssetVariantInterface, implements Neos\Media\Domain\Model\ImageInterface, use trait DimensionsTrait
파일 보기 프로젝트 열기: neos/neos-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$adjustments ArrayCollection<\Neos\Media\Domain\Model\Adjustment\AbstractImageAdjustment>
$imageService Neos\Media\Domain\Service\ImageService
$name string
$originalAsset Image

공개 메소드들

메소드 설명
__construct ( Image $originalAsset ) Constructs a new Image Variant based on the given original
addAdjustment ( Neos\Media\Domain\Model\Adjustment\ImageAdjustmentInterface $adjustment ) : void Adds the given adjustment to the list of adjustments applied to this image variant.
addAdjustments ( array $adjustments ) : void Adds the given adjustments to the list of adjustments applied to this image variant.
addTag ( Tag $tag ) : void Add a single tag to this asset
addVariant ( ImageVariant $variant ) : void Adding variants to variants is not supported.
getAdjustments ( ) : Doctrine\Common\Collections\Collection
getCaption ( ) : string Returns the caption of the original image
getFileExtension ( ) : string File extension of the image without leading dot.
getName ( ) : string Returns the name
getOriginalAsset ( ) : Image Returns the original image this variant is based on
getResource ( ) : PersistentResource Returns the resource of this image variant
getTitle ( ) : string Returns the title of the original image
getVariants ( ) : array Retrieving variants from variants is not supported (no-operation)
initializeObject ( integer $initializationCause ) : void Initialize this image variant
refresh ( ) : void Refreshes this image variant: according to the added adjustments, a new image is rendered and stored as this image variant's resource.
setName ( string $name ) : void Sets a name which can be used for identifying this variant
setResource ( PersistentResource $resource ) : void Setting the image resource on an ImageVariant is not allowed, this method will throw a RuntimeException.
setTags ( Doctrine\Common\Collections\Collection $tags ) : void Set the tags assigned to this asset
setTitle ( string $title ) : void Setting the title on an ImageVariant is not allowed, this method will throw a RuntimeException.

보호된 메소드들

메소드 설명
applyAdjustment ( Neos\Media\Domain\Model\Adjustment\ImageAdjustmentInterface $adjustment ) : void Apply the given adjustment to the image variant.
renderResource ( ) : void Tells the ImageService to render the resource of this ImageVariant according to the existing adjustments.

메소드 상세

__construct() 공개 메소드

Constructs a new Image Variant based on the given original
public __construct ( Image $originalAsset )
$originalAsset Image The original Image asset this variant is derived from

addAdjustment() 공개 메소드

If an adjustment of the given type already exists, the existing one will be overridden by the new one.
public addAdjustment ( Neos\Media\Domain\Model\Adjustment\ImageAdjustmentInterface $adjustment ) : void
$adjustment Neos\Media\Domain\Model\Adjustment\ImageAdjustmentInterface The adjustment to apply
리턴 void

addAdjustments() 공개 메소드

If an adjustment of one of the given types already exists, the existing one will be overridden by the new one.
public addAdjustments ( array $adjustments ) : void
$adjustments array
리턴 void

addTag() 공개 메소드

Add a single tag to this asset
public addTag ( Tag $tag ) : void
$tag Tag
리턴 void

addVariant() 공개 메소드

Adding variants to variants is not supported.
public addVariant ( ImageVariant $variant ) : void
$variant ImageVariant
리턴 void

applyAdjustment() 보호된 메소드

If an adjustment of the given type already exists, the existing one will be overridden by the new one.
protected applyAdjustment ( Neos\Media\Domain\Model\Adjustment\ImageAdjustmentInterface $adjustment ) : void
$adjustment Neos\Media\Domain\Model\Adjustment\ImageAdjustmentInterface
리턴 void

getAdjustments() 공개 메소드

public getAdjustments ( ) : Doctrine\Common\Collections\Collection
리턴 Doctrine\Common\Collections\Collection

getCaption() 공개 메소드

Returns the caption of the original image
public getCaption ( ) : string
리턴 string

getFileExtension() 공개 메소드

This will return the file extension of the original image as this should not be different in image variants
public getFileExtension ( ) : string
리턴 string

getName() 공개 메소드

Returns the name
public getName ( ) : string
리턴 string

getOriginalAsset() 공개 메소드

Returns the original image this variant is based on
public getOriginalAsset ( ) : Image
리턴 Image

getResource() 공개 메소드

Returns the resource of this image variant
public getResource ( ) : PersistentResource
리턴 Neos\Flow\ResourceManagement\PersistentResource

getTitle() 공개 메소드

Returns the title of the original image
public getTitle ( ) : string
리턴 string

getVariants() 공개 메소드

Retrieving variants from variants is not supported (no-operation)
public getVariants ( ) : array
리턴 array

initializeObject() 공개 메소드

This method will generate the resource of this asset when this object has just been newly created. We can't run renderResource() in the constructor since not all dependencies have been injected then. Generating resources lazily in the getResource() method is not feasible either, because getters will be triggered by the validation mechanism on flushing the persistence which will result in undefined behavior. We don't call refresh() here because we only want the resource to be rendered, not all other refresh actions from parent classes being executed.
public initializeObject ( integer $initializationCause ) : void
$initializationCause integer
리턴 void

refresh() 공개 메소드

Refreshes this image variant: according to the added adjustments, a new image is rendered and stored as this image variant's resource.
또한 보기: getResource()
public refresh ( ) : void
리턴 void

renderResource() 보호된 메소드

Tells the ImageService to render the resource of this ImageVariant according to the existing adjustments.
protected renderResource ( ) : void
리턴 void

setName() 공개 메소드

Sets a name which can be used for identifying this variant
public setName ( string $name ) : void
$name string
리턴 void

setResource() 공개 메소드

Setting the image resource on an ImageVariant is not allowed, this method will throw a RuntimeException.
public setResource ( PersistentResource $resource ) : void
$resource Neos\Flow\ResourceManagement\PersistentResource
리턴 void

setTags() 공개 메소드

Set the tags assigned to this asset
public setTags ( Doctrine\Common\Collections\Collection $tags ) : void
$tags Doctrine\Common\Collections\Collection
리턴 void

setTitle() 공개 메소드

Setting the title on an ImageVariant is not allowed, this method will throw a RuntimeException.
public setTitle ( string $title ) : void
$title string
리턴 void

프로퍼티 상세

$adjustments 보호되어 있는 프로퍼티

protected ArrayCollection<\Neos\Media\Domain\Model\Adjustment\AbstractImageAdjustment> $adjustments
리턴 ArrayCollection<\Neos\Media\Domain\Model\Adjustment\AbstractImageAdjustment>

$imageService 보호되어 있는 프로퍼티

protected ImageService,Neos\Media\Domain\Service $imageService
리턴 Neos\Media\Domain\Service\ImageService

$name 보호되어 있는 프로퍼티

protected string $name
리턴 string

$originalAsset 보호되어 있는 프로퍼티

protected Image,Neos\Media\Domain\Model $originalAsset
리턴 Image