PHP Classes

File: QueryTemplatesSourceReplicator.php

Recommend this page to a friend!
  Classes of   Query Templates   QueryTemplatesSourceReplicator.php   Download  
File: QueryTemplatesSourceReplicator.php
Role: Class source
Content type: text/plain
Description: QueryTemplatesSourceReplicator.php
Class: Query Templates
Template engine using load, traverse and modify
Author: By
Last change:
Date: 15 years ago
Size: 985 bytes
 

Contents

Class file image Download
<?php
/**
 * Class used to store calls to source object for later
 * replication.
 *
 * @access private
 * @package QueryTemplates
 * @author Tobiasz Cudnik <tobiasz.cudnik/gmail.com>
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
 * @link http://code.google.com/p/querytemplates/
 */
class QueryTemplatesSourceReplicator {
    public
$calls = array();
    public
$parent;
    public function
__construct($parent) {
       
$this->parent = $parent;
    }
    public function
__call($name, $arguments) {
       
$parentMethods = array(
           
'source', 'sourceQuery', 'sourcePHP', 'sourceQueryPHP', 'parse', 'noCache'
       
);
        if (
in_array($name, $parentMethods))
           
// call parent method
           
return call_user_method_array($name, $this->parent, $arguments);
       
$endingMethods = array('sourceEnd');
        if (
in_array($name, $endingMethods))
           
// we're ended
           
return $this->parent;
       
// store call
       
$this->calls[] = array($name, $arguments);
        return
$this;
    }
}