PHP Class Jackalope\Transport\DoctrineDBAL\Client

Author: Benjamin Eberlei ([email protected])
Author: Lukas Kahwe Smith ([email protected])
Inheritance: extends Jackalope\Transport\BaseTransport, implements Jackalope\Transport\QueryInterface, implements Jackalope\Transport\WritingInterface, implements Jackalope\Transport\WorkspaceManagementInterface, implements Jackalope\Transport\NodeTypeManagementInterface, implements Jackalope\Transport\TransactionInterface
Afficher le fichier Open project: jackalope/jackalope-doctrine-dbal Class Usage Examples

Protected Properties

Свойство Type Description
$factory Jackalope\FactoryInterface The factory to instantiate objects
$inTransaction boolean
$namespaces null | ArrayObject Using an ArrayObject here so that we can pass this into the NodeProcessor by reference more elegantly
$valueConverter PHPCR\Util\ValueConverter
$workspaceName string

Méthodes publiques

Méthode Description
__construct ( Jackalope\FactoryInterface $factory, Doctrine\DBAL\Connection $conn )
beginTransaction ( ) {@inheritDoc}
cloneFrom ( $srcWorkspace, $srcAbsPath, $destAbsPath, $removeExisting ) {@inheritDoc}
commitTransaction ( ) {@inheritDoc}
copyNode ( $srcAbsPath, $dstAbsPath, $srcWorkspace = null ) {@inheritDoc}
createWorkspace ( $name, $srcWorkspace = null ) {@inheritDoc}
deleteNodeImmediately ( $path ) {@inheritDoc}
deleteNodes ( array $operations ) {@inheritDoc}
deleteProperties ( array $operations ) {@inheritDoc}
deletePropertyImmediately ( $path ) {@inheritDoc}
deleteWorkspace ( $name ) {@inheritDoc}
finishSave ( ) {@inheritDoc}
getAccessibleWorkspaceNames ( ) {@inheritDoc}
getBinaryStream ( $path ) {@inheritDoc}
getConnection ( ) : Doctrine\DBAL\Connection
getNamespaces ( ) {@inheritDoc}
getNode ( $path ) {@inheritDoc}
getNodeByIdentifier ( $uuid ) {@inheritDoc}
getNodePathForIdentifier ( $uuid, $workspace = null ) {@inheritDoc}
getNodeTypes ( $nodeTypes = [] ) {@inheritDoc}
getNodes ( $paths ) {@inheritDoc}
getNodesByIdentifier ( $identifiers ) {@inheritDoc}
getProperty ( $path ) {@inheritDoc}
getReferences ( $path, $name = null ) {@inheritDoc}
getRepositoryDescriptors ( ) {@inheritDoc}
getSupportedQueryLanguages ( ) {@inheritDoc}
getWeakReferences ( $path, $name = null ) {@inheritDoc}
login ( PHPCR\CredentialsInterface $credentials = null, $workspaceName = null ) {@inheritDoc}
logout ( ) {@inheritDoc}
moveNodeImmediately ( $srcAbsPath, $dstAbspath ) {@inheritDoc}
moveNodes ( array $operations ) {@inheritDoc}
prepareSave ( ) {@inheritDoc}
query ( Query $query ) {@inheritDoc}
registerNamespace ( $prefix, $uri ) {@inheritDoc}
registerNodeTypes ( $types, $allowUpdate ) {@inheritDoc}
reorderChildren ( Node $node ) {@inheritDoc}
rollbackSave ( ) {@inheritDoc}
rollbackTransaction ( ) {@inheritDoc}
setCheckLoginOnServer ( $bool ) Configure whether to check if we are logged in before doing a request.
setNodeTypeManager ( $nodeTypeManager ) {@inheritDoc}
setTransactionTimeout ( integer $seconds ) Sets the default transaction timeout
setUuidGenerator ( Closure $generator ) Set the UUID generator to use. If not set, the phpcr-utils UUIDHelper will be used.
storeNodes ( array $operations ) {@inheritDoc}
unregisterNamespace ( $prefix ) {@inheritDoc}
updateNode ( Node $node, $srcWorkspace ) {@inheritDoc}
updateProperties ( Node $node )

Méthodes protégées

Méthode Description
assertLoggedIn ( ) Ensure that we are currently logged in, executing the login in case we did lazy login.
deleteNode ( string $path ) TODO instead of calling the deletes separately, we should batch the delete query but careful with the caching!
deleteProperty ( $path ) {@inheritDoc}
fetchUserNodeTypes ( ) : array Fetch a user-defined node-type definition.
generateUuid ( ) : string
getIdentifier ( string $path, Property[] $properties ) : string Determine a UUID for the node at this path with these properties
getNamespacesObject ( ) : ArrayObject Return the namespaces of the current session as a referenceable ArrayObject.
getUuidGenerator ( ) : callable
mapPropertyFromElement ( DOMElement $propertyNode, stdClass $data ) Map a property from the given property XML node to the given \stdClass node representation
moveNode ( $srcAbsPath, $dstAbsPath ) Execute moving a single node
setNamespaces ( array | ArrayObject $namespaces ) Set the namespaces property to an \ArrayObject instance
storeNode ( string $path, Property[] $properties ) : boolean Make sure we have a uuid and a primaryType, then sync data into the database
workspaceExists ( $workspaceName )
xmlToColumns ( string $xml, array $propertyNames ) : stdClass Convert the node XML to stdClass node representation containing only the given properties
xmlToProps ( string $xml ) : stdClass Convert the node XML to stdClass node representation containing all properties

Private Methods

Méthode Description
cleanIdentifierCache ( string $root ) Clean all identifiers under path $root.
ensureNamespacesBackup ( ) We need to create an in memory backup when we are inside a transaction so that we can efficiently restore the original state in the namespaces property in case of a rollback.
executeChunkedUpdate ( $query, array $params ) Executes an UPDATE on DBAL while ensuring that we never try to send more than 999 parameters to SQLite
getJcrName ( string $path ) : array
getNamespacePrefixes ( ) : array Get the registered namespace prefixes
getNodeData ( array $row ) : stdClass Convert a node result row to the stdClass representing all raw data.
getNodeProcessor ( ) : NodeProcessor Return the node processor for processing nodes according to their node types.
getNodeReferences ( string $path, string $name = null, boolean $weakReference = false ) : array
getNodesData ( array $rows ) : stdClass[] Build the raw data for a list of database result rows, fetching the additional information in one single query.
getSystemIdForNode ( string $identifier, string $workspaceName = null ) : boolean | string Get the database primary key for node.
initConnection ( ) Initialize the dbal connection lazily
nestNode ( stdClass $ancestor, stdClass $node, array $nodeNames ) Attach a node at a subpath under the ancestor node.
pathExists ( string $path, string $workspaceName = null ) : boolean Determine if a path exists already.
propsToXML ( array $properties ) : array Seperate properties array into an xml and binary data.
registerSqliteFunctions ( PDO $sqliteConnection ) : Client
syncBinaryData ( $nodeId, $binaryData )
syncNode ( string $uuid, string $path, string $type, boolean $isNewNode, Property[] $props = [], array $propsData = [] ) : boolean | string Actually write the node into the database
syncReferences ( array $referencesToUpdate )

Method Details

__construct() public méthode

public __construct ( Jackalope\FactoryInterface $factory, Doctrine\DBAL\Connection $conn )
$factory Jackalope\FactoryInterface
$conn Doctrine\DBAL\Connection

assertLoggedIn() protected méthode

Ensure that we are currently logged in, executing the login in case we did lazy login.
protected assertLoggedIn ( )

beginTransaction() public méthode

{@inheritDoc}
public beginTransaction ( )

cloneFrom() public méthode

{@inheritDoc}
public cloneFrom ( $srcWorkspace, $srcAbsPath, $destAbsPath, $removeExisting )

commitTransaction() public méthode

{@inheritDoc}
public commitTransaction ( )

copyNode() public méthode

{@inheritDoc}
public copyNode ( $srcAbsPath, $dstAbsPath, $srcWorkspace = null )

createWorkspace() public méthode

{@inheritDoc}
public createWorkspace ( $name, $srcWorkspace = null )

deleteNode() protected méthode

TODO instead of calling the deletes separately, we should batch the delete query but careful with the caching!
protected deleteNode ( string $path )
$path string node path to delete

deleteNodeImmediately() public méthode

{@inheritDoc}
public deleteNodeImmediately ( $path )

deleteNodes() public méthode

{@inheritDoc}
public deleteNodes ( array $operations )
$operations array

deleteProperties() public méthode

{@inheritDoc}
public deleteProperties ( array $operations )
$operations array

deleteProperty() protected méthode

{@inheritDoc}
protected deleteProperty ( $path )

deletePropertyImmediately() public méthode

{@inheritDoc}
public deletePropertyImmediately ( $path )

deleteWorkspace() public méthode

{@inheritDoc}
public deleteWorkspace ( $name )

fetchUserNodeTypes() protected méthode

Fetch a user-defined node-type definition.
protected fetchUserNodeTypes ( ) : array
Résultat array

finishSave() public méthode

{@inheritDoc}
public finishSave ( )

generateUuid() protected méthode

protected generateUuid ( ) : string
Résultat string a universally unique id.

getAccessibleWorkspaceNames() public méthode

{@inheritDoc}

getBinaryStream() public méthode

{@inheritDoc}
public getBinaryStream ( $path )

getConnection() public méthode

public getConnection ( ) : Doctrine\DBAL\Connection
Résultat Doctrine\DBAL\Connection

getIdentifier() protected méthode

Determine a UUID for the node at this path with these properties
protected getIdentifier ( string $path, Property[] $properties ) : string
$path string
$properties Jackalope\Property[]
Résultat string a unique id

getNamespaces() public méthode

{@inheritDoc}
public getNamespaces ( )

getNamespacesObject() protected méthode

Return the namespaces of the current session as a referenceable ArrayObject.
protected getNamespacesObject ( ) : ArrayObject
Résultat ArrayObject

getNode() public méthode

{@inheritDoc}
public getNode ( $path )

getNodeByIdentifier() public méthode

{@inheritDoc}
public getNodeByIdentifier ( $uuid )

getNodePathForIdentifier() public méthode

{@inheritDoc}
public getNodePathForIdentifier ( $uuid, $workspace = null )

getNodeTypes() public méthode

{@inheritDoc}
public getNodeTypes ( $nodeTypes = [] )

getNodes() public méthode

{@inheritDoc}
public getNodes ( $paths )

getNodesByIdentifier() public méthode

{@inheritDoc}
public getNodesByIdentifier ( $identifiers )

getProperty() public méthode

{@inheritDoc}
public getProperty ( $path )

getReferences() public méthode

{@inheritDoc}
public getReferences ( $path, $name = null )

getRepositoryDescriptors() public méthode

{@inheritDoc}

getSupportedQueryLanguages() public méthode

{@inheritDoc}

getUuidGenerator() protected méthode

protected getUuidGenerator ( ) : callable
Résultat callable a uuid generator function.

getWeakReferences() public méthode

{@inheritDoc}
public getWeakReferences ( $path, $name = null )

login() public méthode

{@inheritDoc}
public login ( PHPCR\CredentialsInterface $credentials = null, $workspaceName = null )
$credentials PHPCR\CredentialsInterface

logout() public méthode

{@inheritDoc}
public logout ( )

mapPropertyFromElement() protected méthode

Map a property from the given property XML node to the given \stdClass node representation
protected mapPropertyFromElement ( DOMElement $propertyNode, stdClass $data )
$propertyNode DOMElement
$data stdClass

moveNode() protected méthode

Execute moving a single node
protected moveNode ( $srcAbsPath, $dstAbsPath )

moveNodeImmediately() public méthode

{@inheritDoc}
public moveNodeImmediately ( $srcAbsPath, $dstAbspath )

moveNodes() public méthode

{@inheritDoc}
public moveNodes ( array $operations )
$operations array

prepareSave() public méthode

{@inheritDoc}
public prepareSave ( )

query() public méthode

{@inheritDoc}
public query ( Query $query )
$query Jackalope\Query\Query

registerNamespace() public méthode

{@inheritDoc}
public registerNamespace ( $prefix, $uri )

registerNodeTypes() public méthode

{@inheritDoc}
public registerNodeTypes ( $types, $allowUpdate )

reorderChildren() public méthode

{@inheritDoc}
public reorderChildren ( Node $node )
$node Jackalope\Node

rollbackSave() public méthode

{@inheritDoc}
public rollbackSave ( )

rollbackTransaction() public méthode

{@inheritDoc}
public rollbackTransaction ( )

setCheckLoginOnServer() public méthode

Will improve error reporting at the cost of some round trips.
public setCheckLoginOnServer ( $bool )

setNamespaces() protected méthode

Set the namespaces property to an \ArrayObject instance
protected setNamespaces ( array | ArrayObject $namespaces )
$namespaces array | ArrayObject

setNodeTypeManager() public méthode

{@inheritDoc}
public setNodeTypeManager ( $nodeTypeManager )

setTransactionTimeout() public méthode

Sets the default transaction timeout
public setTransactionTimeout ( integer $seconds )
$seconds integer The value of the timeout in seconds

setUuidGenerator() public méthode

Set the UUID generator to use. If not set, the phpcr-utils UUIDHelper will be used.
public setUuidGenerator ( Closure $generator )
$generator Closure

storeNode() protected méthode

Make sure we have a uuid and a primaryType, then sync data into the database
protected storeNode ( string $path, Property[] $properties ) : boolean
$path string the path to store the node at
$properties Jackalope\Property[] the properties of this node
Résultat boolean true on success

storeNodes() public méthode

{@inheritDoc}
public storeNodes ( array $operations )
$operations array

unregisterNamespace() public méthode

{@inheritDoc}
public unregisterNamespace ( $prefix )

updateNode() public méthode

{@inheritDoc}
public updateNode ( Node $node, $srcWorkspace )
$node Jackalope\Node

updateProperties() public méthode

public updateProperties ( Node $node )
$node Jackalope\Node the node to update

workspaceExists() protected méthode

protected workspaceExists ( $workspaceName )

xmlToColumns() protected méthode

Convert the node XML to stdClass node representation containing only the given properties
protected xmlToColumns ( string $xml, array $propertyNames ) : stdClass
$xml string
$propertyNames array
Résultat stdClass

xmlToProps() protected méthode

Convert the node XML to stdClass node representation containing all properties
protected xmlToProps ( string $xml ) : stdClass
$xml string
Résultat stdClass

Property Details

$factory protected_oe property

The factory to instantiate objects
protected FactoryInterface,Jackalope $factory
Résultat Jackalope\FactoryInterface

$inTransaction protected_oe property

protected bool $inTransaction
Résultat boolean

$namespaces protected_oe property

Using an ArrayObject here so that we can pass this into the NodeProcessor by reference more elegantly
protected null|ArrayObject $namespaces
Résultat null | ArrayObject

$valueConverter protected_oe property

protected ValueConverter,PHPCR\Util $valueConverter
Résultat PHPCR\Util\ValueConverter

$workspaceName protected_oe property

protected string $workspaceName
Résultat string