PHP Класс Neos\Flow\ResourceManagement\PersistentResource

Наследование: implements Neos\Flow\ResourceManagement\ResourceMetaDataInterface, implements Neos\Cache\CacheAwareInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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
public getRelativePublicationPath ( ) : string
Результат string

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