class File extends AbstractFile (View source)

This class represents a JCR file, aka nt:file.

Properties

protected $id from AbstractFile
protected $node from AbstractFile
protected $nodename from AbstractFile
protected $parent from AbstractFile
protected $created from AbstractFile
protected $createdBy from AbstractFile
protected resource $content

Methods

$this
setId(string $id)

Set the id (the PHPCR path).

string
getId()

Get for id (the PHPCR path).

string
getNodename()

The node name of the file.

$this
setNodename(string $name)

Set the node name of the file. (only mutable on new document before the persist).

object|null
getParentDocument()

The parent document of this document. Could be a Folder.

$this
setParentDocument(object $parent)

Set the parent document of this document.

getCreated()

getter for created The created date is assigned by the content repository.

string
getCreatedBy()

getter for createdBy The createdBy is assigned by the content repository This is the name of the (jcr) user that created the node.

string
__toString()

String representation.

$this
setFileContentFromFilesystem(string $filename)

Set the content for this file from the given filename.

$this
setContent(Resource $content)

Set the content for this file from the given Resource.

getContent()

No description

$this
setFileContent(resource|string $content)

Set the content for this file from the given resource or string.

stream
getFileContentAsStream()

Get a stream for the content of this file.

string
getFileContent()

Get the content for this file as string.

Details

$this setId(string $id)

Set the id (the PHPCR path).

Parameters

string $id of the node

Return Value

$this

string getId()

Get for id (the PHPCR path).

Return Value

string id of the document.

string getNodename()

The node name of the file.

Return Value

string

$this setNodename(string $name)

Set the node name of the file. (only mutable on new document before the persist).

Parameters

string $name the name of the file

Return Value

$this

object|null getParentDocument()

The parent document of this document. Could be a Folder.

Return Value

object|null

$this setParentDocument(object $parent)

Set the parent document of this document.

Parameters

object $parent

Return Value

$this

DateTime getCreated()

getter for created The created date is assigned by the content repository.

Return Value

DateTime created date of the file

string getCreatedBy()

getter for createdBy The createdBy is assigned by the content repository This is the name of the (jcr) user that created the node.

Return Value

string name of the (jcr) user who created the file

string __toString()

String representation.

Return Value

string

$this setFileContentFromFilesystem(string $filename)

Set the content for this file from the given filename.

Calls file_get_contents with the given filename.

Parameters

string $filename name of the file which contents should be used

Return Value

$this

Exceptions

RuntimeException If the filename does not point to a file that can be read.

$this setContent(Resource $content)

Set the content for this file from the given Resource.

Parameters

Resource $content

Return Value

$this

getContent()

$this setFileContent(resource|string $content)

Set the content for this file from the given resource or string.

Parameters

resource|string $content the content for the file

Return Value

$this

stream getFileContentAsStream()

Get a stream for the content of this file.

Return Value

stream the content for the file

string getFileContent()

Get the content for this file as string.

Return Value

string the content for the file in a string