* @package phpcr * @subpackage nodetype */ interface NodeType { /** * Returns the name of the node type. * * @return the name of the node type */ public function getName(); /** * Returns true if this node type is a mixin node type. * Returns false if this node type is a primary node type. * * @return a boolean */ public function isMixin(); /** * 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 {@link Node#orderBefore}. If a node type returns false * on a call to this method, then nodes of that node type may support these ordering methods. 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. * * @return Returns true if nodes of this type must support orderable child nodes; returns * false otherwise. */ public function hasOrderableChildNodes(); /** * Returns the name of the primary item (one of the child items of the node's of this node type). * If this node has no primary item, then this method returns null. * This indicator is used by the method {@link Node#getPrimaryItem()}. * * @return the name of the primary item. */ public function getPrimaryItemName(); /** * Returns all supertypes of this node type including both those directly * declared and those inherited. For primary types, this list will always * include at least nt:base. For mixin types, there is no * required base type. * * @see #getDeclaredSupertypes * * @return an array of NodeType objects. */ public function getSupertypes(); /** * Returns all direct supertypes as specified in the declaration of * 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. * * @see #getSupertypes * * @return an array of NodeType objects. */ public function getDeclaredSupertypes(); /** * Returns true if this node type is nodeTypeName * or a subtype of nodeTypeName, otherwise returns * false. * @param nodeTypeName the name of a node type. * @return a boolean */ public function isNodeType( $nodeTypeName ); /** * Returns an array containing the property definitions of this node type, * including the property definitions inherited from supertypes of this node * type. * * @see #getDeclaredPropertyDefinitions * * @return an array containing the property definitions. */ public function getPropertyDefinitions(); /** * Returns an array containing the property definitions explicitly specified * in the declaration of this node type. This does not include * property definitions inherited from supertypes of this node type. * * @see #getPropertyDefinitions * * @return an array containing the property definitions. */ public function getDeclaredPropertyDefinitions(); /** * Returns an array containing the child node definitions of this node type, * including the child node definitions inherited from supertypes of this * node type. * * @see #getDeclaredChildNodeDefinitions * * @return an array containing the child node definitions. */ public function getChildNodeDefinitions(); /** * Returns an array containing the child node definitions explicitly * specified in the declaration of this node type. This does * not include child node definitions inherited from supertypes of * this node type. * * @see #getChildNodeDefinitions * @return an array containing the child node definitions. */ public function getDeclaredChildNodeDefinitions(); /** * Returns true if setting propertyName to * value is allowed by this node type. Otherwise returns * false. * * @param propertyName The name of the property * @param value A Value object. */ public function canSetProperty( $propertyName, $value ); /** * Returns true if adding a child node called * childNodeName is allowed by this node type. *

* * @param childNodeName The name of the child node. * @param nodeTypeName The name of the node type of the child node. */ public function canAddChildNode( $childNodeName, $nodeTypeName = null ); /** * Returns true if removing the child item called itemName is allowed by this node type. * Otherwise returns false. * * @param itemName The name of the child item */ public function canRemoveItem( $itemName ); } ?>