| 1 | <?php |
| 2 | /* |
| 3 | * $Id$ |
| 4 | * |
| 5 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 6 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 7 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 8 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 9 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 10 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 11 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 12 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 13 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 14 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 15 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 16 | * |
| 17 | * This software consists of voluntary contributions made by many individuals |
| 18 | * and is licensed under the LGPL. For more information, see |
| 19 | * <http://www.phpdoctrine.org>. |
| 20 | */ |
| 21 | Doctrine::autoload('Doctrine_Record_Abstract'); |
| 22 | /** |
| 23 | * Doctrine_Template |
| 24 | * |
| 25 | * @package Doctrine |
| 26 | * @subpackage Template |
| 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL |
| 28 | * @link www.phpdoctrine.org |
| 29 | * @since 1.0 |
| 30 | * @version $Revision$ |
| 31 | * @author Konsta Vesterinen <kvesteri@cc.hut.fi> |
| 32 | */ |
| 33 | class Doctrine_Template extends Doctrine_Record_Abstract |
| 34 | { |
| 35 | /** |
| 36 | * @param Doctrine_Record $_invoker the record that invoked the last delegated call |
| 37 | */ |
| 38 | protected $_invoker; |
| 39 | |
| 40 | |
| 41 | protected $_plugin; |
| 42 | |
| 43 | /** |
| 44 | * setTable |
| 45 | * |
| 46 | * @param Doctrine_Table $_table the table object this Template belongs to |
| 47 | */ |
| 48 | public function setTable(Doctrine_Table $table) |
| 49 | { |
| 50 | $this->_table = $table; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * getTable |
| 55 | * returns the associated table object |
| 56 | * |
| 57 | * @return Doctrine_Table the associated table object |
| 58 | */ |
| 59 | public function getTable() |
| 60 | { |
| 61 | return $this->_table; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * setInvoker |
| 66 | * |
| 67 | * sets the last used invoker |
| 68 | * |
| 69 | * @param Doctrine_Record $invoker the record that invoked the last delegated call |
| 70 | * @return Doctrine_Template this object |
| 71 | */ |
| 72 | public function setInvoker(Doctrine_Record $invoker) |
| 73 | { |
| 74 | $this->_invoker = $invoker; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * setInvoker |
| 79 | * returns the last used invoker |
| 80 | * |
| 81 | * @return Doctrine_Record the record that invoked the last delegated call |
| 82 | */ |
| 83 | public function getInvoker() |
| 84 | { |
| 85 | return $this->_invoker; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * addChild |
| 90 | * |
| 91 | * Adds a plugin as a child to this plugin |
| 92 | * |
| 93 | * @param Doctrine_Template $template |
| 94 | * @return Doctrine_Template. Chainable. |
| 95 | */ |
| 96 | public function addChild(Doctrine_Template $template) |
| 97 | { |
| 98 | $this->_plugin->addChild($template); |
| 99 | |
| 100 | return $this; |
| 101 | } |
| 102 | |
| 103 | |
| 104 | /** |
| 105 | * getPlugin |
| 106 | * |
| 107 | * @return void |
| 108 | */ |
| 109 | public function getPlugin() |
| 110 | { |
| 111 | return $this->_plugin; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * get |
| 116 | * |
| 117 | * @param mixed $name |
| 118 | * @return void |
| 119 | */ |
| 120 | public function get($name) |
| 121 | { |
| 122 | throw new Doctrine_Exception("Templates doesn't support accessors."); |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * set |
| 127 | * |
| 128 | * @param mixed $name |
| 129 | * @param mixed $value |
| 130 | * @return void |
| 131 | */ |
| 132 | public function set($name, $value) |
| 133 | { |
| 134 | throw new Doctrine_Exception("Templates doesn't support accessors."); |
| 135 | } |
| 136 | /** |
| 137 | * setUp |
| 138 | * |
| 139 | * @return void |
| 140 | */ |
| 141 | public function setUp() |
| 142 | { |
| 143 | |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * setTableDefinition |
| 148 | * |
| 149 | * @return void |
| 150 | */ |
| 151 | public function setTableDefinition() |
| 152 | { |
| 153 | |
| 154 | } |
| 155 | } |