phpcr/src/PHPCR/NodeType/NodeTypeInterface.php
Copyright 2008-2011 Karsten Dambekalns karsten@typo3.org
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
\PHPCR\NodeType\NodeTypeInterface
The information methods may be used both before and after the node type is registered. Its subclass NodeType adds methods that are relevant only when the node type is "live"; that is, after it has been registered. Note that the separate NodeDefinition interface only plays a significant role in implementations that support node type registration.
In those cases it serves as the superclass of both NodeType and NodeTypeTemplate. In implementations that do not support node type registration, only objects implementing the subinterface NodeType will be encountered.
- Parent(s)
- \PHPCR\NodeType\NodeTypeDefinitionInterface
- Api
Constants
NT_BASE
= "{http://www.jcp.org/jcr/nt/1.0}base"
Constants for the names of the properties declared by nt:base are:
- \PHPCR\PropertyInterface::JCR_PRIMARY_TYPE
- \PHPCR\PropertyInterface::JCR_MIXIN_TYPES
- Api
NT_HIERARCHY_NODE
= "{http://www.jcp.org/jcr/nt/1.0}hierarchyNode"
- Api
NT_FOLDER
= "{http://www.jcp.org/jcr/nt/1.0}folder"
- Api
NT_FILE
= "{http://www.jcp.org/jcr/nt/1.0}file"
A constant for the name of the child node declared by nt:file is: \PHPCR\NodeInterface::JCR_CONTENT
- Api
NT_LINKED_FILE
= "{http://www.jcp.org/jcr/nt/1.0}linkedFile"
A constant for the name of the property declared by nt:linkedFile is: \PHPCR\PropertyInterface::JCR_CONTENT
- Api
NT_RESOURCE
= "{http://www.jcp.org/jcr/nt/1.0}resource"
A constant for the name of the property declared by nt:resource is: \PHPCR\PropertyInterface::JCR_DATA
- Api
NT_UNSTRUCTURED
= "{http://www.jcp.org/jcr/nt/1.0}unstructured"
- Api
NT_ADDRESS
= "{http://www.jcp.org/jcr/nt/1.0}address"
Constants for the names of the properties declared by nt:base are:
- \PHPCR\PropertyInterface::JCR_PROTOCOL
- \PHPCR\PropertyInterface::JCR_HOST
- \PHPCR\PropertyInterface::JCR_PORT
- \PHPCR\PropertyInterface::JCR_REPOSITORY
- \PHPCR\PropertyInterface::JCR_WORKSPACE
- \PHPCR\PropertyInterface::JCR_PATH
- \PHPCR\PropertyInterface::JCR_ID
- Api
MIX_REFERENCEABLE
= "{http://www.jcp.org/mix/1.0}referenceable"
A constant for the name of the property declared by mix:referenceable is: \PHPCR\PropertyInterface::JCR_UUID
- Api
MIX_TITLE
= "{http://www.jcp.org/mix/1.0}title"
Constants for the names of the properties declared by mix:title are:
- \PHPCR\PropertyInterface::JCR_TITLE
- \PHPCR\PropertyInterface::JCR_DESCRIPTION
- Api
MIX_CREATED
= "{http://www.jcp.org/mix/1.0}created"
Constants for the names of the properties declared by mix:created are:
- \PHPCR\PropertyInterface::JCR_CREATED
- \PHPCR\PropertyInterface::JCR_CREATED_BY
- Api
MIX_LAST_MODIFIED
= "{http://www.jcp.org/mix/1.0}lastModified"
Constants for the names of the properties declared by mix:lastModified are:
- \PHPCR\PropertyInterface::JCR_LAST_MODIFIED
- \PHPCR\PropertyInterface::JCR_LAST_MODIFIED_BY
- Api
MIX_LANGUAGE
= "{http://www.jcp.org/mix/1.0}language"
A constant for the name of the property declared by mix:language is: \PHPCR\PropertyInterface::JCR_LANGUAGE
- Api
MIX_MIMETYPE
= "{http://www.jcp.org/mix/1.0}mimeType"
Constants for the names of the properties declared by mix:mimeType are:
- \PHPCR\PropertyInterface::JCR_MIMETYPE
- \PHPCR\PropertyInterface::JCR_ENCODING
- Api
NT_NODE_TYPE
= "{http://www.jcp.org/jcr/nt/1.0}nodeType"
Constants for the names of the child items declared by nt:nodeType are:
- \PHPCR\PropertyInterface::JCR_NODE_TYPE_NAME
- \PHPCR\PropertyInterface::JCR_SUPERTYPES
- \PHPCR\PropertyInterface::JCR_IS_ABSTRACT
- \PHPCR\PropertyInterface::JCR_IS_MIXIN
- \PHPCR\PropertyInterface::JCR_HAS_ORDERABLE_CHILD_NODES
- \PHPCR\PropertyInterface::JCR_PRIMARY_ITEM_NAME
- \PHPCR\NodeInterface::JCR_PROPERTY_DEFINITION
- \PHPCR\NodeInterface::JCR_CHILD_NODE_DEFINITION
- Api
NT_PROPERTY_DEFINITION
= "{http://www.jcp.org/jcr/nt/1.0}propertyDefinition"
Constants for the names of the properties declared by nt:propertyDefinition are:
- \PHPCR\PropertyInterface::JCR_NAME
- \PHPCR\PropertyInterface::JCR_AUTOCREATED
- \PHPCR\PropertyInterface::JCR_MANDATORY
- \PHPCR\PropertyInterface::JCR_PROTECTED
- \PHPCR\PropertyInterface::JCR_ON_PARENT_VERSION
- \PHPCR\PropertyInterface::JCR_REQUIRED_TYPE
- \PHPCR\PropertyInterface::JCR_VALUE_CONSTRAINTS
- \PHPCR\PropertyInterface::JCR_DEFAULT_VALUES
- \PHPCR\PropertyInterface::JCR_MULTIPLE
- Api
NT_CHILD_NODE_DEFINITION
= "{http://www.jcp.org/jcr/nt/1.0}childNodeDefinition"
Constants for the names of the properties declared by nt:childNodeDefinition are:
- \PHPCR\PropertyInterface::JCR_NAME
- \PHPCR\PropertyInterface::JCR_AUTOCREATED
- \PHPCR\PropertyInterface::JCR_MANDATORY
- \PHPCR\PropertyInterface::JCR_PROTECTED
- \PHPCR\PropertyInterface::JCR_ON_PARENT_VERSION
- \PHPCR\PropertyInterface::JCR_REQUIRED_PRIMARY_TYPES
- \PHPCR\PropertyInterface::JCR_DEFAULT_PRIMARY_TYPE
- \PHPCR\PropertyInterface::JCR_SAME_NAME_SIBLINGS
- Api
MIX_SHAREABLE
= "{http://www.jcp.org/mix/1.0}shareable"
- Api
MIX_LOCKABLE
= "{http://www.jcp.org/mix/1.0}lockable"
Constants for the names of the properties declared by mix:lockable are:
- \PHPCR\PropertyInterface::JCR_LOCK_OWNER
- \PHPCR\PropertyInterface::JCR_LOCK_IS_DEEP
- Api
MIX_LIFECYCLE
= "{http://www.jcp.org/mix/1.0}lifecycle"
Constants for the names of the properties declared by mix:lifecycle are:
- \PHPCR\PropertyInterface::JCR_LIFECYCLE_POLICY
- \PHPCR\PropertyInterface::JCR_CURRENT_LIFECYCLE_STATE
- Api
MIX_SIMPLE_VERSIONABLE
= "{http://www.jcp.org/mix/1.0}simpleVersionable"
A constant for the name of the property declared by mix:simpleVersionable is: \PHPCR\PropertyInterface::JCR_IS_CHECKED_OUT
- Api
MIX_VERSIONABLE
= "{http://www.jcp.org/mix/1.0}versionable"
Constants for the names of the properties declared by mix:versionable are:
- \PHPCR\PropertyInterface::JCR_VERSION_HISTORY
- \PHPCR\PropertyInterface::JCR_BASE_VERSION
- \PHPCR\PropertyInterface::JCR_PREDECESSORS
- \PHPCR\PropertyInterface::JCR_MERGE_FAILED
- \PHPCR\PropertyInterface::JCR_ACTIVITY
- \PHPCR\PropertyInterface::JCR_CONFIGURATION
- Api
NT_VERSION_HISTORY
= "{http://www.jcp.org/jcr/nt/1.0}versionHistory"
Constants for the names of the child items declared by nt:versionHistory are:
- \PHPCR\PropertyInterface::JCR_VERSIONABLE_UUID
- \PHPCR\PropertyInterface::JCR_COPIED_FROM
- \PHPCR\NodeInterface::JCR_ROOT_VERSION
- \PHPCR\NodeInterface::JCR_VERSION_LABELS
- Api
NT_VERSION
= "{http://www.jcp.org/jcr/nt/1.0}version"
Constants for the names of the child items declared by nt:version are:
- \PHPCR\PropertyInterface::JCR_CREATED
- \PHPCR\PropertyInterface::JCR_PREDECESSORS
- \PHPCR\PropertyInterface::JCR_SUCCESSORS
- \PHPCR\PropertyInterface::JCR_ACTIVITY
- \PHPCR\NodeInterface::JCR_FROZEN_NODE
- Api
NT_FROZEN_NODE
= "{http://www.jcp.org/jcr/nt/1.0}frozenNode"
Constants for the names of the properties declared by nt:frozenNode are:
- \PHPCR\PropertyInterface::JCR_FROZEN_PRIMARY_TYPE
- \PHPCR\PropertyInterface::JCR_FROZEN_MIXIN_TYPES
- \PHPCR\PropertyInterface::JCR_FROZEN_UUID
- Api
NT_VERSIONED_CHILD
= "{http://www.jcp.org/jcr/nt/1.0}versionedChild"
A constant for the name of the property declared by nt:versionedChild is: \PHPCR\PropertyInterface::JCR_CHILD_VERSION_HISTORY
- Api
NT_ACTIVITY
= "{http://www.jcp.org/jcr/nt/1.0}activity"
A constant for the name of the property declared by nt:activity is: \PHPCR\PropertyInterface::JCR_TITLE
- Api
NT_CONFIGURATION
= "{http://www.jcp.org/jcr/nt/1.0}configuration"
A constant for the name of the property declared by nt:configuration is: \PHPCR\PropertyInterface::JCR_ROOT
- Api
Methods
canAddChildNode(string $childNodeName, string $nodeTypeName = null) : boolean
Determines if this node type allows the addition of a child node.
Returns true if this node type allows the addition of a child node called childNodeName without specific node type information (that is, given the definition of this parent node type, the child node name is sufficient to determine the intended child node type). Returns false otherwise. If $nodeTypeName is given returns true if this node type allows the addition of a child node called childNodeName of node type nodeTypeName. Returns false otherwise.
Name | Type | Description |
---|---|---|
$childNodeName | string | The name of the child node. |
$nodeTypeName | string | The name of the node type of the child node. |
Type | Description |
---|---|
boolean | True, if the node type allows the addition of a child node, else false. |
- Api
canRemoveNode(string $nodeName) : boolean
Reports if the node type allows the removal of the given node.
Returns true if removing the child node called nodeName is allowed by this node type. Returns false otherwise.
Name | Type | Description |
---|---|---|
$nodeName | string | The name of the child node. |
Type | Description |
---|---|
boolean | True, if the node type allows to remove the passed node, else false. |
- Api
canRemoveProperty(string $propertyName) : boolean
Determines if the node type allows to remove the property identified by the given name.
Returns true if removing the property called propertyName is allowed by this node type. Returns false otherwise.
Name | Type | Description |
---|---|---|
$propertyName | string | The name of the property |
Type | Description |
---|---|
boolean | True, if the removal of the property is allowed, else false. |
- Api
canSetProperty(string $propertyName, mixed $value) : boolean
Determines if the node type allows to set the value of a property.
Returns true if setting propertyName is allowed and the value is of the required type or can be converted into that type. Otherwise returns false.
Name | Type | Description |
---|---|---|
$propertyName | string | The name of the property |
$value | mixed | A value or an array of values |
Type | Description |
---|---|
boolean | True if setting propertyName to value is allowed by this node type, else false. |
- Api
getChildNodeDefinitions() : array
Returns an array containing the child node definitions of this node type.
This includes both those child node definitions actually declared in this node type and those inherited from the supertypes of this node type.
Type | Description |
---|---|
array | An array of \PHPCR\NodeType\NodeDefinitionInterface containing the child node definitions. |
- Api
getDeclaredChildNodeDefinitions() : array
Returns an array containing the child node definitions actually declared in this node type.
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::getDeclaredChildNodeDefinitions()In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return null.
Type | Description |
---|---|
array | An array of NodeDefinitions. |
- Api
getDeclaredPropertyDefinitions() : array
Returns an array containing the property definitions actually declared in this node type.
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::getDeclaredPropertyDefinitions()In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return null.
Type | Description |
---|---|
array | An array of PropertyDefinitions. |
- Api
getDeclaredSubtypes() : \Iterator
Returns the direct subtypes of this node type in the node type inheritance hierarchy, that is, those which actually declared this node type in their list of supertypes.
Type | Description |
---|---|
\Iterator | implementing <b>SeekableIterator</b> and <b>Countable</b>. Keys are the node type names, values the corresponding NodeTypeInterface instances. |
- Api
- See
- \PHPCR\NodeType\getSubtypes()
getDeclaredSupertypeNames() : array
Returns the names of the supertypes actually declared in this node type.
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::getDeclaredSupertypeNames()In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return an array containing a single string indicating the node type nt:base.
Type | Description |
---|---|
array | List of names of declared supertypes. |
- Api
getDeclaredSupertypes() : array
Returns the direct supertypes of this node type in the node type inheritance hierarchy, that is, those actually declared in this node type.
In single-inheritance systems, this will always be an array of size 0 or 1. In systems that support multiple inheritance of node types this array may be of size greater than 1.
Type | Description |
---|---|
array | List of \PHPCR\NodeType\NodeTypeInterface objects. |
- Api
getName() : string
Returns the name of the node type.
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::getName()In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return null.
Type | Description |
---|---|
string | The name of the node type. |
- Api
getPrimaryItemName() : string
Returns the name of the primary item (one of the child items of the nodes of this node type).
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::getPrimaryItemName()If this node has no primary item, then this method returns null. This indicator is used by the method NodeInterface::getPrimaryItem().
In implementations that support node type registration, if this NodeTypeDefinitionInterface object is actually a newly-created empty NodeTypeTemplateInterface, then this method will return null.
Type | Description |
---|---|
string | The name of the primary item. |
- Api
getPropertyDefinitions() : array
Returns an array containing the property definitions of this node type.
This includes both those property definitions actually declared in this node type and those inherited from the supertypes of this type.
Type | Description |
---|---|
array | An array of \PHPCR\NodeType\PropertyDefinition containing the property definitions. |
- Api
getSubtypes() : \Iterator
Returns all subtypes of this node type in the node type inheritance hierarchy.
Type | Description |
---|---|
\Iterator | implementing <b>SeekableIterator</b> and <b>Countable</b>. Keys are the node type names, values the corresponding NodeTypeInterface instances. |
- Api
- See
- \PHPCR\NodeType\getDeclaredSubtypes()
getSupertypeNames() : string[]
Returns the names of all supertypes of this node type in the node type inheritance hierarchy.
For primary types apart from nt:base, this list will always include at least nt:base. For mixin types, there is no required supertype.
Type | Description |
---|---|
string[] | the names of all supertypes |
- See
- \PHPCR\NodeType\getSupertypes()
- See
- \PHPCR\NodeType\NodeTypeDefinition::getDeclaredSupertypeNames()
- Since
- JCR 2.1
getSupertypes() : array
Returns all supertypes of this node type in the node type inheritance hierarchy.
For primary types apart from nt:base, this list will always include at least nt:base. For mixin types, there is no required supertype.
Type | Description |
---|---|
array | List of \PHPCR\NodeType\NodeType objects. |
- Api
hasOrderableChildNodes() : boolean
Determines if nodes of this type must support orderable child nodes.
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::hasOrderableChildNodes()Returns true if nodes of this type must support orderable child nodes; returns false otherwise. If a node type returns true on a call to this method, then all nodes of that node type must support the method NodeInterface::orderBefore(). If a node type returns false on a call to this method, then nodes of that node type may support NodeInterface::orderBefore(). Only the primary node type of a node controls that node's status in this regard. This setting on a mixin node type will not have any effect on the node.
In implementations that support node type registration, if this NodeTypeDefinitionInterface object is actually a newly-created empty NodeTypeTemplateInterface, then this method will return false.
Type | Description |
---|---|
boolean | True, if nodes of this type must support orderable child nodes, else false. |
- Api
isAbstract() : boolean
Reports if this is an abstract node type.
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::isAbstract()Returns true if this is an abstract node type; returns false otherwise. An abstract node type is one that cannot be assigned as the primary or mixin type of a node but can be used in the definitions of other node types as a superclass.
In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return false.
Type | Description |
---|---|
boolean | True, if the current type is abstract, else false. |
- Api
isMixin() : boolean
Reports if this is a mixin node type.
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::isMixin()Returns true if this is a mixin type; returns false if it is primary. In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return false.
Type | Description |
---|---|
boolean | True if this is a mixin type, else false; |
- Api
isNodeType(string $nodeTypeName) : boolean
Reports if the name of this node type or any of its direct or indirect supertypes is equal to nodeTypeName.
Returns true if the name of this node type or any of its direct or indirect supertypes is equal to nodeTypeName, otherwise returns false.
Name | Type | Description |
---|---|---|
$nodeTypeName | string | the name of a node type. |
Type | Description |
---|---|
boolean |
- Api
isQueryable() : boolean
Determins if the node type is queryable.
Inherited from: \PHPCR\NodeType\NodeTypeDefinitionInterface::isQueryable()Returns true if the node type is queryable, meaning that the available-query-operators, full-text-searchable and query-orderable attributes of its property definitions take effect.
If a node type is declared non-queryable then these attributes of its property definitions have no effect.
Type | Description |
---|---|
boolean | True, if the node type is queryable, else false. |
- Api
- See
- \PHPCR\NodeType\PropertyDefinition::getAvailableQueryOperators()
- See
- \PHPCR\NodeType\PropertyDefinition::isFullTextSearchable()
- See
- \PHPCR\NodeType\PropertyDefinition::isQueryOrderable()