NullNode.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 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 
15 
16 /**
17  * NullNode is an implementation of the NullObject pattern,
18  * It inherits all functionality from Node (acts like a Node)
19  * and is only distinguishable from a Node instance by it's class or oid.
20  * If a Node's parent is a NullNode instance, than they should be separated
21  * in the data store (e.g. the foreign key should be null, if allowed by the database).
22  * NullNode child instances should be ignored.
23  *
24  * @author ingo herwig <ingo@wemove.com>
25  */
26 class NullNode extends Node {
27 
28  /**
29  * @see PersistentObject::getOID()
30  */
31  public function getOID() {
32  return new ObjectId($this->getType(), null);
33  }
34 }
35 ?>