Template.php 3.8 KB
Newer Older
zYne's avatar
zYne committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<?php
/*
 *  $Id$
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information, see
 * <http://www.phpdoctrine.com>.
 */
zYne's avatar
zYne committed
21
Doctrine::autoload('Doctrine_Record_Abstract');
zYne's avatar
zYne committed
22 23 24 25
/**
 * Doctrine_Template
 *
 * @package     Doctrine
26
 * @subpackage  Template
zYne's avatar
zYne committed
27 28 29 30 31 32 33 34
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @link        www.phpdoctrine.com
 * @since       1.0
 * @version     $Revision$
 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
 */
class Doctrine_Template extends Doctrine_Record_Abstract
{
zYne's avatar
zYne committed
35 36 37 38
    /**
     * @param Doctrine_Record $_invoker     the record that invoked the last delegated call
     */
    protected $_invoker;
zYne's avatar
zYne committed
39 40 41
    
    
    protected $_plugin;
42

zYne's avatar
zYne committed
43
    /**
zYne's avatar
zYne committed
44
     * setTable
zYne's avatar
zYne committed
45
     *
zYne's avatar
zYne committed
46
     * @param Doctrine_Table $_table        the table object this Template belongs to
zYne's avatar
zYne committed
47
     */
zYne's avatar
zYne committed
48
    public function setTable(Doctrine_Table $table)
zYne's avatar
zYne committed
49 50 51
    {
        $this->_table = $table;
    }
52

zYne's avatar
zYne committed
53 54 55 56
    /**
     * getTable
     * returns the associated table object
     *
zYne's avatar
zYne committed
57
     * @return Doctrine_Table               the associated table object
zYne's avatar
zYne committed
58 59 60 61 62
     */
    public function getTable()
    {
        return $this->_table;
    }
63

zYne's avatar
zYne committed
64 65 66 67 68 69 70 71 72 73 74 75
    /**
     * setInvoker
     *
     * sets the last used invoker
     *
     * @param Doctrine_Record $invoker      the record that invoked the last delegated call
     * @return Doctrine_Template            this object
     */
    public function setInvoker(Doctrine_Record $invoker)
    {
        $this->_invoker = $invoker;
    }
76

zYne's avatar
zYne committed
77 78 79 80 81 82 83 84 85 86
    /**
     * setInvoker
     * returns the last used invoker
     *
     * @return Doctrine_Record              the record that invoked the last delegated call
     */
    public function getInvoker()
    {
        return $this->_invoker;
    }
zYne's avatar
zYne committed
87

88 89 90 91 92 93 94 95
    /**
     * addChild 
     *
     * Adds a plugin as a child to this plugin
     * 
     * @param Doctrine_Template $template 
     * @return Doctrine_Template. Chainable.
     */
zYne's avatar
zYne committed
96 97 98 99 100 101 102 103
    public function addChild(Doctrine_Template $template)
    {
        $this->_plugin->addChild($template);
        
        return $this;
    }


104 105 106 107 108
    /**
     * getPlugin 
     * 
     * @return void
     */
zYne's avatar
zYne committed
109 110 111 112
    public function getPlugin()
    {
        return $this->_plugin;
    }
zYne's avatar
zYne committed
113

114 115 116 117 118 119
    /**
     * get 
     * 
     * @param mixed $name 
     * @return void
     */
zYne's avatar
zYne committed
120 121 122 123
    public function get($name) 
    {
        throw new Doctrine_Exception("Templates doesn't support accessors.");
    }
124 125 126 127 128 129 130 131

    /**
     * set 
     * 
     * @param mixed $name 
     * @param mixed $value 
     * @return void
     */
zYne's avatar
zYne committed
132 133 134 135
    public function set($name, $value)
    {
        throw new Doctrine_Exception("Templates doesn't support accessors.");
    }
136 137 138 139 140
    /**
     * setUp 
     * 
     * @return void
     */
zYne's avatar
zYne committed
141 142
    public function setUp()
    {
zYne's avatar
zYne committed
143

zYne's avatar
zYne committed
144
    }
zYne's avatar
zYne committed
145

146 147 148 149 150
    /**
     * setTableDefinition 
     * 
     * @return void
     */
zYne's avatar
zYne committed
151 152 153 154
    public function setTableDefinition()
    {

    }
zYne's avatar
zYne committed
155
}