NullNode.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 namespace wcmf\lib\model;
12 
16 
17 /**
18  * NullNode is an implementation of the NullObject pattern,
19  * It inherits all functionality from Node (acts like a Node)
20  * and is only distinguishable from a Node instance by it's class or oid.
21  * If a Node's parent is a NullNode instance, than they should be separated
22  * in the data store (e.g. the foreign key should be null, if allowed by the database).
23  * NullNode child instances should be ignored.
24  *
25  * @author ingo herwig <ingo@wemove.com>
26  */
27 class NullNode extends Node {
28 
29  /**
30  * @see PersistentObject::getOID()
31  */
32  public function getOID() {
33  return new ObjectId($this->_type, NULL);
34  }
35 }
36 ?>
Node related interfaces and classes.
Definition: namespaces.php:26
ObjectId is the unique identifier of an object.
Definition: ObjectId.php:27
NullNode is an implementation of the NullObject pattern, It inherits all functionality from Node (act...
Definition: NullNode.php:27
Node adds the concept of relations to PersistentObject.
Definition: Node.php:34