PHP 클래스 Neos\Flow\ResourceManagement\PersistentResource

상속: implements Neos\Flow\ResourceManagement\ResourceMetaDataInterface, implements Neos\Cache\CacheAwareInterface
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$collectionName string Name of a collection whose storage is used for storing this resource and whose target is used for publishing.
$deleted boolean An internal flag which tells if this PersistentResource object has been deleted during the current request
$environment Neos\Flow\Utility\Environment
$fileSize integer The size of this object's data
$filename string Filename which is used when the data of this resource is downloaded as a file or acting as a label
$lifecycleEventsActive boolean
$md5 string MD5 hash identifying the content attached to this resource
$mediaType string The IANA media type of this resource
$protected boolean As soon as the PersistentResource has been published, modifying this object is not allowed
$relativePublicationPath string An optional relative path which can be used by a publishing target for structuring resources into directories
$resourceManager ResourceManager
$sha1 string SHA1 hash identifying the content attached to this resource
$systemLogger Neos\Flow\Log\SystemLoggerInterface
$temporaryLocalCopyPathAndFilename string

공개 메소드들

메소드 설명
__toString ( ) : string Returns the SHA1 of the content this PersistentResource is related to
createTemporaryLocalCopy ( ) : string Returns the path to a local file representing this resource for use with read-only file operations such as reading or copying.
disableLifecycleEvents ( ) : void A very internal function which disables the Doctrine lifecycle events for this PersistentResource.
getCacheEntryIdentifier ( ) : string Returns a string which distinctly identifies this object and thus can be used as an identifier for cache entries related to this object. Introduced through the CacheAwareInterface.
getCollectionName ( ) : string Returns the name of the collection this resource is part of
getFileExtension ( ) : string Returns the file extension used for this resource
getFileSize ( ) : integer Returns the size of the content of this resource
getFilename ( ) : string Gets the filename
getHash ( ) : string Returns the sha1 hash of the content of this resource
getMd5 ( ) : string Returns the MD5 hash of the content of this resource
getMediaType ( ) : string Returns the Media Type for this resource
getRelativePublicationPath ( ) : string Returns the relative publication path
getResourcePointer ( ) : ResourcePointer Returns the resource pointer
getSha1 ( ) : string Returns the SHA1 hash of the content of this resource
getStream ( ) : resource | boolean Returns a stream for use with read-only file operations such as reading or copying.
initializeObject ( integer $initializationCause ) : void Protects this PersistentResource if it has been persisted already.
isDeleted ( ) : boolean An internal method which tells if this PersistentResource object has been already deleted by the ResourceManager.
postPersist ( ) : void Doctrine lifecycle event callback which is triggered on "postPersist" events.
preRemove ( ) : void Doctrine lifecycle event callback which is triggered on "preRemove" events.
setCollectionName ( string $collectionName ) : void Sets the name of the collection this resource should be part of
setDeleted ( boolean $flag = true ) : void An internal method which marks the PersistentResource object as deleted.
setFileSize ( integer $fileSize ) : void Sets the size of the content of this resource
setFilename ( string $filename ) : void Sets the filename which is used when this resource is downloaded or saved as a file
setHash ( string $hash ) : void Sets the SHA1 hash of the content of this resource
setMd5 ( string $md5 ) : void Sets the MD5 hash of the content of this resource
setMediaType ( string $mediaType ) : void Explicitly sets the Media Type for this resource
setRelativePublicationPath ( string $path ) : void Sets a relative path which can be used by a publishing target for structuring resources into directories
setResourcePointer ( ResourcePointer $resourcePointer ) : void Sets the resource pointer
setSha1 ( string $sha1 ) : void Sets the SHA1 hash of the content of this resource
shutdownObject ( ) : void Takes care of removing a possibly existing temporary local copy on destruction of this object.

보호된 메소드들

메소드 설명
throwExceptionIfProtected ( ) : void Throws an exception if this PersistentResource object is protected against modifications.

메소드 상세

__toString() 공개 메소드

Returns the SHA1 of the content this PersistentResource is related to
사용 중단: Since version 3.0. Use getSha1() to get a textual representation
public __toString ( ) : string
리턴 string

createTemporaryLocalCopy() 공개 메소드

Note that you must not store or publish file paths returned from this method as they will change with every request.
public createTemporaryLocalCopy ( ) : string
리턴 string Absolute path and filename pointing to the temporary local copy of this resource

disableLifecycleEvents() 공개 메소드

This is needed when some low-level operations need to be done, for example deleting a PersistentResource from the ResourceRepository without unpublishing the (probably not existing) data from the storage.
public disableLifecycleEvents ( ) : void
리턴 void

getCacheEntryIdentifier() 공개 메소드

Returns a string which distinctly identifies this object and thus can be used as an identifier for cache entries related to this object. Introduced through the CacheAwareInterface.
public getCacheEntryIdentifier ( ) : string
리턴 string

getCollectionName() 공개 메소드

Returns the name of the collection this resource is part of
public getCollectionName ( ) : string
리턴 string Name of the collection, for example "persistentResources"

getFileExtension() 공개 메소드

Returns the file extension used for this resource
public getFileExtension ( ) : string
리턴 string The file extension used for this file

getFileSize() 공개 메소드

Returns the size of the content of this resource
public getFileSize ( ) : integer
리턴 integer The content size

getFilename() 공개 메소드

Gets the filename
public getFilename ( ) : string
리턴 string The filename

getHash() 공개 메소드

Returns the sha1 hash of the content of this resource
사용 중단: Since version 3.0, please use getSha1() instead
public getHash ( ) : string
리턴 string The sha1 hash

getMd5() 공개 메소드

Returns the MD5 hash of the content of this resource
public getMd5 ( ) : string
리턴 string The MD5 hash

getMediaType() 공개 메소드

Returns the Media Type for this resource
public getMediaType ( ) : string
리턴 string The IANA Media Type

getRelativePublicationPath() 공개 메소드

Returns the relative publication path

getResourcePointer() 공개 메소드

Deprecated – use getSha1() instead!
또한 보기: getSha1()
사용 중단: Since version 3.0, use getSha1() which is the same value
public getResourcePointer ( ) : ResourcePointer
리턴 ResourcePointer $resourcePointer

getSha1() 공개 메소드

Returns the SHA1 hash of the content of this resource
public getSha1 ( ) : string
리턴 string The sha1 hash

getStream() 공개 메소드

Note: The caller is responsible to close the returned resource by calling fclose($stream)
public getStream ( ) : resource | boolean
리턴 resource | boolean | boolean A stream which points to the data of this resource for read-access or FALSE if the stream could not be obtained

initializeObject() 공개 메소드

Protects this PersistentResource if it has been persisted already.
public initializeObject ( integer $initializationCause ) : void
$initializationCause integer
리턴 void

isDeleted() 공개 메소드

An internal method which tells if this PersistentResource object has been already deleted by the ResourceManager.
public isDeleted ( ) : boolean
리턴 boolean

postPersist() 공개 메소드

This method triggers the publication of this resource.
public postPersist ( ) : void
리턴 void

preRemove() 공개 메소드

This method triggers the deletion of data related to this resource.
public preRemove ( ) : void
리턴 void

setCollectionName() 공개 메소드

Sets the name of the collection this resource should be part of
public setCollectionName ( string $collectionName ) : void
$collectionName string Name of the collection
리턴 void

setDeleted() 공개 메소드

This method is called by the ResourceManager in order to prevent other code parts, for example the Doctrine lifecycle events, to delete this resource again.
public setDeleted ( boolean $flag = true ) : void
$flag boolean
리턴 void

setFileSize() 공개 메소드

Sets the size of the content of this resource
public setFileSize ( integer $fileSize ) : void
$fileSize integer The content size
리턴 void

setFilename() 공개 메소드

Sets the filename which is used when this resource is downloaded or saved as a file
public setFilename ( string $filename ) : void
$filename string
리턴 void

setHash() 공개 메소드

Sets the SHA1 hash of the content of this resource
사용 중단: Since version 3.0, please use setSha1() instead
public setHash ( string $hash ) : void
$hash string The sha1 hash
리턴 void

setMd5() 공개 메소드

Sets the MD5 hash of the content of this resource
public setMd5 ( string $md5 ) : void
$md5 string The MD5 hash
리턴 void

setMediaType() 공개 메소드

Explicitly sets the Media Type for this resource
public setMediaType ( string $mediaType ) : void
$mediaType string The IANA Media Type
리턴 void

setRelativePublicationPath() 공개 메소드

Sets a relative path which can be used by a publishing target for structuring resources into directories
public setRelativePublicationPath ( string $path ) : void
$path string
리턴 void

setResourcePointer() 공개 메소드

Deprecated – use setSha1() instead!
또한 보기: setSha1()
사용 중단: Since version 3.0, use setSha1() to set the raw hash of the resourcePointer
public setResourcePointer ( ResourcePointer $resourcePointer ) : void
$resourcePointer ResourcePointer
리턴 void

setSha1() 공개 메소드

Sets the SHA1 hash of the content of this resource
public setSha1 ( string $sha1 ) : void
$sha1 string The sha1 hash
리턴 void

shutdownObject() 공개 메소드

Note: we can't use __destruct() here because this would lead Doctrine to create a proxy method __destruct() which will run __load(), which in turn will trigger the SQL protection in Flow Security, which will then discover that a possibly previously existing session has been half-destroyed already (see FLOW-121).
public shutdownObject ( ) : void
리턴 void

throwExceptionIfProtected() 보호된 메소드

Throws an exception if this PersistentResource object is protected against modifications.
protected throwExceptionIfProtected ( ) : void
리턴 void

프로퍼티 상세

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

Name of a collection whose storage is used for storing this resource and whose target is used for publishing.
protected string $collectionName
리턴 string

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

An internal flag which tells if this PersistentResource object has been deleted during the current request
protected bool $deleted
리턴 boolean

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

protected Environment,Neos\Flow\Utility $environment
리턴 Neos\Flow\Utility\Environment

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

The size of this object's data
protected int $fileSize
리턴 integer

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

Filename which is used when the data of this resource is downloaded as a file or acting as a label
protected string $filename
리턴 string

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

protected bool $lifecycleEventsActive
리턴 boolean

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

MD5 hash identifying the content attached to this resource
protected string $md5
리턴 string

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

The IANA media type of this resource
protected string $mediaType
리턴 string

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

As soon as the PersistentResource has been published, modifying this object is not allowed
protected bool $protected
리턴 boolean

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

An optional relative path which can be used by a publishing target for structuring resources into directories
protected string $relativePublicationPath
리턴 string

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

protected ResourceManager,Neos\Flow\ResourceManagement $resourceManager
리턴 ResourceManager

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

SHA1 hash identifying the content attached to this resource
protected string $sha1
리턴 string

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

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
리턴 Neos\Flow\Log\SystemLoggerInterface

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

protected string $temporaryLocalCopyPathAndFilename
리턴 string