phpcr/src/PHPCR/NodeType/NodeTypeInterface.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    This file is part of the PHPCR API and was originally ported from the Java JCR API to PHP by Karsten Dambekalns for the FLOW3 project.

    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.

    License
    Apache Software License 2.0  
    Link
    http://phpcr.github.com/  

    \PHPCR\NodeType\NodeTypeInterface

    Package: Default
    A NodeType object represents a "live" node type that is registered in the repository.

    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

    >VConstant  NT_BASE = "{http://www.jcp.org/jcr/nt/1.0}base"
    A constant for the node type name nt:base (in extended form).

    Constants for the names of the properties declared by nt:base are:

    • \PHPCR\PropertyInterface::JCR_PRIMARY_TYPE
    • \PHPCR\PropertyInterface::JCR_MIXIN_TYPES
    Api
     
    >VConstant  NT_HIERARCHY_NODE = "{http://www.jcp.org/jcr/nt/1.0}hierarchyNode"
    A constant for the node type name nt:hierarchyNode (in extended form).
    Api
     
    >VConstant  NT_FOLDER = "{http://www.jcp.org/jcr/nt/1.0}folder"
    A constant for the node type name nt:folder (in extended form).
    Api
     
    >VConstant  NT_FILE = "{http://www.jcp.org/jcr/nt/1.0}file"
    A constant for the node type name nt:file (in extended form).

    A constant for the name of the child node declared by nt:file is: \PHPCR\NodeInterface::JCR_CONTENT

    Api
     
    >VConstant  NT_LINKED_FILE = "{http://www.jcp.org/jcr/nt/1.0}linkedFile"
    A constant for the node type name nt:linkedFile (in extended form).

    A constant for the name of the property declared by nt:linkedFile is: \PHPCR\PropertyInterface::JCR_CONTENT

    Api
     
    >VConstant  NT_RESOURCE = "{http://www.jcp.org/jcr/nt/1.0}resource"
    A constant for the node type name nt:resource (in extended form).

    A constant for the name of the property declared by nt:resource is: \PHPCR\PropertyInterface::JCR_DATA

    Api
     
    >VConstant  NT_UNSTRUCTURED = "{http://www.jcp.org/jcr/nt/1.0}unstructured"
    A constant for the node type name nt:unstructured (in extended form).
    Api
     
    >VConstant  NT_ADDRESS = "{http://www.jcp.org/jcr/nt/1.0}address"
    A constant for the node type name nt:address (in extended form).

    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
     
    >VConstant  MIX_REFERENCEABLE = "{http://www.jcp.org/mix/1.0}referenceable"
    A constant for the node type name mix:referenceable (in extended form).

    A constant for the name of the property declared by mix:referenceable is: \PHPCR\PropertyInterface::JCR_UUID

    Api
     
    >VConstant  MIX_TITLE = "{http://www.jcp.org/mix/1.0}title"
    A constant for the node type name mix:title (in extended form).

    Constants for the names of the properties declared by mix:title are:

    • \PHPCR\PropertyInterface::JCR_TITLE
    • \PHPCR\PropertyInterface::JCR_DESCRIPTION
    Api
     
    >VConstant  MIX_CREATED = "{http://www.jcp.org/mix/1.0}created"
    A constant for the node type name mix:created (in extended form).

    Constants for the names of the properties declared by mix:created are:

    • \PHPCR\PropertyInterface::JCR_CREATED
    • \PHPCR\PropertyInterface::JCR_CREATED_BY
    Api
     
    >VConstant  MIX_LAST_MODIFIED = "{http://www.jcp.org/mix/1.0}lastModified"
    A constant for the node type name mix:lastModified (in extended form).

    Constants for the names of the properties declared by mix:lastModified are:

    • \PHPCR\PropertyInterface::JCR_LAST_MODIFIED
    • \PHPCR\PropertyInterface::JCR_LAST_MODIFIED_BY
    Api
     
    >VConstant  MIX_LANGUAGE = "{http://www.jcp.org/mix/1.0}language"
    A constant for the node type name mix:language (in extended form).

    A constant for the name of the property declared by mix:language is: \PHPCR\PropertyInterface::JCR_LANGUAGE

    Api
     
    >VConstant  MIX_MIMETYPE = "{http://www.jcp.org/mix/1.0}mimeType"
    A constant for the node type name mix:mimeType (in extended form).

    Constants for the names of the properties declared by mix:mimeType are:

    • \PHPCR\PropertyInterface::JCR_MIMETYPE
    • \PHPCR\PropertyInterface::JCR_ENCODING
    Api
     
    >VConstant  NT_NODE_TYPE = "{http://www.jcp.org/jcr/nt/1.0}nodeType"
    A constant for the node type name nt:nodeType (in extended form).

    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
     
    >VConstant  NT_PROPERTY_DEFINITION = "{http://www.jcp.org/jcr/nt/1.0}propertyDefinition"
    A constant for the node type name nt:propertyDefinition (in extended form).

    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
     
    >VConstant  NT_CHILD_NODE_DEFINITION = "{http://www.jcp.org/jcr/nt/1.0}childNodeDefinition"
    A constant for the node type name nt:childNodeDefinition (in extended form).

    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
     
    >VConstant  MIX_SHAREABLE = "{http://www.jcp.org/mix/1.0}shareable"
    A constant for the node type name mix:shareable (in extended form).
    Api
     
    >VConstant  MIX_LOCKABLE = "{http://www.jcp.org/mix/1.0}lockable"
    A constant for the node type name mix:lockable (in extended form).

    Constants for the names of the properties declared by mix:lockable are:

    • \PHPCR\PropertyInterface::JCR_LOCK_OWNER
    • \PHPCR\PropertyInterface::JCR_LOCK_IS_DEEP
    Api
     
    >VConstant  MIX_LIFECYCLE = "{http://www.jcp.org/mix/1.0}lifecycle"
    A constant for the node type name mix:lifecycle (in extended form).

    Constants for the names of the properties declared by mix:lifecycle are:

    • \PHPCR\PropertyInterface::JCR_LIFECYCLE_POLICY
    • \PHPCR\PropertyInterface::JCR_CURRENT_LIFECYCLE_STATE
    Api
     
    >VConstant  MIX_SIMPLE_VERSIONABLE = "{http://www.jcp.org/mix/1.0}simpleVersionable"
    A constant for the node type name mix:simpleVersionable (in extended form).

    A constant for the name of the property declared by mix:simpleVersionable is: \PHPCR\PropertyInterface::JCR_IS_CHECKED_OUT

    Api
     
    >VConstant  MIX_VERSIONABLE = "{http://www.jcp.org/mix/1.0}versionable"
    A constant for the node type name mix:versionable (in extended form).

    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
     
    >VConstant  NT_VERSION_HISTORY = "{http://www.jcp.org/jcr/nt/1.0}versionHistory"
    A constant for the node type name nt:versionHistory (in extended form).

    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
     
    >VConstant  NT_VERSION = "{http://www.jcp.org/jcr/nt/1.0}version"
    A constant for the node type name nt:version (in extended form).

    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
     
    >VConstant  NT_FROZEN_NODE = "{http://www.jcp.org/jcr/nt/1.0}frozenNode"
    A constant for the node type name nt:frozenNode (in extended form).

    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
     
    >VConstant  NT_VERSIONED_CHILD = "{http://www.jcp.org/jcr/nt/1.0}versionedChild"
    A constant for the node type name nt:versionedChild (in extended form).

    A constant for the name of the property declared by nt:versionedChild is: \PHPCR\PropertyInterface::JCR_CHILD_VERSION_HISTORY

    Api
     
    >VConstant  NT_ACTIVITY = "{http://www.jcp.org/jcr/nt/1.0}activity"
    A constant for the node type name nt:activity (in extended form).

    A constant for the name of the property declared by nt:activity is: \PHPCR\PropertyInterface::JCR_TITLE

    Api
     
    >VConstant  NT_CONFIGURATION = "{http://www.jcp.org/jcr/nt/1.0}configuration"
    A constant for the node type name nt:configuration (in extended form).

    A constant for the name of the property declared by nt:configuration is: \PHPCR\PropertyInterface::JCR_ROOT

    Api
     
    >VConstant  NT_QUERY = "{http://www.jcp.org/jcr/nt/1.0}query"
    A constant for the node type name nt:query (in extended form).

    Constants for the names of the properties declared by nt:query are:

    • \PHPCR\PropertyInterface::JCR_STATEMENT
    • \PHPCR\PropertyInterface::JCR_LANGUAGE
    Api
     

    Methods

    methodpubliccanAddChildNode(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.

    Parameters
    NameTypeDescription
    $childNodeNamestring

    The name of the child node.

    $nodeTypeNamestring

    The name of the node type of the child node.

    Returns
    TypeDescription
    booleanTrue, if the node type allows the addition of a child node, else false.
    Details
    Api
     
    methodpubliccanRemoveNode(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.

    Parameters
    NameTypeDescription
    $nodeNamestring

    The name of the child node.

    Returns
    TypeDescription
    booleanTrue, if the node type allows to remove the passed node, else false.
    Details
    Api
     
    methodpubliccanRemoveProperty(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.

    Parameters
    NameTypeDescription
    $propertyNamestring

    The name of the property

    Returns
    TypeDescription
    booleanTrue, if the removal of the property is allowed, else false.
    Details
    Api
     
    methodpubliccanSetProperty(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.

    Parameters
    NameTypeDescription
    $propertyNamestring

    The name of the property

    $valuemixed

    A value or an array of values

    Returns
    TypeDescription
    booleanTrue if setting propertyName to value is allowed by this node type, else false.
    Details
    Api
     
    methodpublicgetChildNodeDefinitions() : 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.

    Returns
    TypeDescription
    arrayAn array of \PHPCR\NodeType\NodeDefinitionInterface containing the child node definitions.
    Details
    Api
     
    methodpublicgetDeclaredChildNodeDefinitions() : array
    inherited

    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.

    Returns
    TypeDescription
    arrayAn array of NodeDefinitions.
    Details
    Api
     
    methodpublicgetDeclaredPropertyDefinitions() : array
    inherited

    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.

    Returns
    TypeDescription
    arrayAn array of PropertyDefinitions.
    Details
    Api
     
    methodpublicgetDeclaredSubtypes() : \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.

    Returns
    TypeDescription
    \Iteratorimplementing <b>SeekableIterator</b> and <b>Countable</b>. Keys are the node type names, values the corresponding NodeTypeInterface instances.
    Details
    Api
     
    See
    \PHPCR\NodeType\getSubtypes()  
    methodpublicgetDeclaredSupertypeNames() : array
    inherited

    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.

    Returns
    TypeDescription
    arrayList of names of declared supertypes.
    Details
    Api
     
    methodpublicgetDeclaredSupertypes() : 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.

    Returns
    TypeDescription
    arrayList of \PHPCR\NodeType\NodeTypeInterface objects.
    Details
    Api
     
    methodpublicgetName() : string
    inherited

    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.

    Returns
    TypeDescription
    stringThe name of the node type.
    Details
    Api
     
    methodpublicgetPrimaryItemName() : string
    inherited

    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.

    Returns
    TypeDescription
    stringThe name of the primary item.
    Details
    Api
     
    methodpublicgetPropertyDefinitions() : 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.

    Returns
    TypeDescription
    arrayAn array of \PHPCR\NodeType\PropertyDefinition containing the property definitions.
    Details
    Api
     
    methodpublicgetSubtypes() : \Iterator

    Returns all subtypes of this node type in the node type inheritance hierarchy.

    Returns
    TypeDescription
    \Iteratorimplementing <b>SeekableIterator</b> and <b>Countable</b>. Keys are the node type names, values the corresponding NodeTypeInterface instances.
    Details
    Api
     
    See
    \PHPCR\NodeType\getDeclaredSubtypes()  
    methodpublicgetSupertypeNames() : 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.

    Returns
    TypeDescription
    string[]the names of all supertypes
    Details
    See
    \PHPCR\NodeType\getSupertypes()  
    See
    \PHPCR\NodeType\NodeTypeDefinition::getDeclaredSupertypeNames()  
    Since
    JCR 2.1  
    methodpublicgetSupertypes() : 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.

    Returns
    TypeDescription
    arrayList of \PHPCR\NodeType\NodeType objects.
    Details
    Api
     
    methodpublichasOrderableChildNodes() : boolean
    inherited

    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.

    Returns
    TypeDescription
    booleanTrue, if nodes of this type must support orderable child nodes, else false.
    Details
    Api
     
    methodpublicisAbstract() : boolean
    inherited

    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.

    Returns
    TypeDescription
    booleanTrue, if the current type is abstract, else false.
    Details
    Api
     
    methodpublicisMixin() : boolean
    inherited

    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.

    Returns
    TypeDescription
    booleanTrue if this is a mixin type, else false;
    Details
    Api
     
    methodpublicisNodeType(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.

    Parameters
    NameTypeDescription
    $nodeTypeNamestring

    the name of a node type.

    Returns
    TypeDescription
    boolean
    Details
    Api
     
    methodpublicisQueryable() : boolean
    inherited

    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.

    Returns
    TypeDescription
    booleanTrue, if the node type is queryable, else false.
    Details
    Api
     
    See
    \PHPCR\NodeType\PropertyDefinition::getAvailableQueryOperators()  
    See
    \PHPCR\NodeType\PropertyDefinition::isFullTextSearchable()  
    See
    \PHPCR\NodeType\PropertyDefinition::isQueryOrderable()  
    Documentation was generated by phpDocumentor 2.0.0a12.