wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.OutputStrategy.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.OutputStrategy.php 1462 2014-02-04 23:52:27Z iherwig $
18  */
19 require_once(BASE."wcmf/lib/core/class.WCMFException.php");
20 
21 /**
22  * @interface OutputStrategy
23  * @ingroup Output
24  * @brief OutputStrategy is used to write an object's content
25  * to a destination (called 'document') using a special format.
26  * OutputStrategy implements the 'Strategy Pattern'.
27  * The abstract base class OutputStrategy defines the interface for all
28  * specialized OutputStrategy classes.
29  *
30  * @author ingo herwig <ingo@wemove.com>
31  */
33 {
34  /**
35  * Write the document header.
36  * Subclasses of OutputStrategy override this method to implement the specialized
37  * format.
38  */
39  function writeHeader()
40  {
41  WCMFException::throwEx("writeHeader() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
42  }
43  /**
44  * Write the document footer.
45  * Subclasses of OutputStrategy override this method to implement the specialized
46  * format.
47  */
48  function writeFooter()
49  {
50  WCMFException::throwEx("writeFooter() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
51  }
52  /**
53  * Write the object's content.
54  * @param obj The object to write.
55  * Subclasses of OutputStrategy override this method to implement the specialized
56  * format.
57  */
58  function writeObject(&$obj)
59  {
60  WCMFException::throwEx("writeObject() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
61  }
62 }
63 ?>
OutputStrategy is used to write an object's content to a destination (called 'document') using a spec...
throwEx($message, $file='', $line='')