wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.NullNode.php
Go to the documentation of this file.
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2014 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of any of the following licenses
7  * at your choice:
8  *
9  * - GNU Lesser General Public License (LGPL)
10  * http://www.gnu.org/licenses/lgpl.html
11  * - Eclipse Public License (EPL)
12  * http://www.eclipse.org/org/documents/epl-v10.php
13  *
14  * See the license.txt file distributed with this work for
15  * additional information.
16  *
17  * $Id: class.NullNode.php 1462 2014-02-04 23:52:27Z iherwig $
18  */
19 require_once(BASE."wcmf/lib/model/class.Node.php");
20 
21 /**
22  * @class NullNode
23  * @ingroup Model
24  * @brief NullNode is an implementation of the NullObject pattern,
25  * It inherits all functionality from Node (acts like a Node)
26  * and is only distinguishable from a Node instance by it's class or oid.
27  * If a Node's parent is a NullNode instance, than they should be separated
28  * in the data store (e.g. the foreign key should be null, if allowed by the database).
29  * NullNode child instances should be ignored. The object id is created using
30  * the following code:
31  * PersistenceFacade::composeOID(array('type' => $this->_type, 'id' => NULL))
32  *
33  * @author ingo herwig <ingo@wemove.com>
34  */
35 class NullNode extends Node
36 {
37  /**
38  * @see PersistentObject::getOID()
39  */
40  function getOID()
41  {
42  return PersistenceFacade::composeOID(array('type' => $this->_type, 'id' => NULL));
43  }
44 
45  /**
46  * @see PersistentObject::getDBID()
47  */
48  function getDBID()
49  {
50  return NULL;
51  }
52 }
53 ?>
Node is the basic component for building trees (although a Node can have one than more parents)...
Definition: class.Node.php:118
NullNode is an implementation of the NullObject pattern, It inherits all functionality from Node (act...