HTML_Table_Matrix
[ class tree: HTML_Table_Matrix ] [ index: HTML_Table_Matrix ] [ all elements ]

Source for file Filler.php

Documentation is available at Filler.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2002 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 3.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/3_0.txt.                                  |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Ian Eure <ieure@php.net>                                    |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: Filler.php 286815 2009-08-04 19:59:06Z cweiske $
  20.  
  21. /**
  22.  * Base class common to all Fillers
  23.  *
  24.  * @author Ian Eure <ieure@php.net>
  25.  * @package HTML_Table_Matrix
  26.  * @since 1.0
  27.  */
  28.     /**
  29.      * Default filler options
  30.      *
  31.      * @type array
  32.      * @access protected
  33.      * @see setOptions()
  34.      */
  35.     var $_defaultOptions = array();
  36.     
  37.     /**
  38.      * Filler options
  39.      *
  40.      * @type array
  41.      * @see setOptions()
  42.      */
  43.     var $options = '';
  44.     
  45.     /**
  46.      * Reference to the HTML_Table_Matrix instance we will be Filling for
  47.      *
  48.      * @type object
  49.      */
  50.     var $matrix = '';
  51.     
  52.     /**
  53.      * Current row to fill
  54.      *
  55.      * @type int
  56.      */
  57.     var $row = 0;
  58.     
  59.     /**
  60.      * Current column to fill
  61.      *
  62.      * @type int
  63.      */
  64.     var $col = 0;
  65.  
  66.     /**
  67.      * Callback function applied to _data
  68.      *
  69.      * @type mixed
  70.      */
  71.     var $callback;
  72.  
  73.     /**
  74.      * Create an instance of a Filler
  75.      *
  76.      * @param string $type Type of filler to instantiate
  77.      * @param Object $matrix Reference to the HTML_Table_Matrix instance
  78.      *                        the Filler will work with
  79.      * @param array $options Filler options
  80.      * @return mixed Filler instance on success, PEAR_Error otherwise
  81.      */
  82.     function &factory($type&$matrix$options = array())
  83.     {
  84.         $class 'HTML_Table_Matrix_Filler_'.$type;
  85.         $file str_replace('_''/'$class).'.php';
  86.         @include_once $file;
  87.         if (!class_exists($class)) {
  88.             return PEAR::raiseError("Filler \"$type\" does not exist.");
  89.         }
  90.         $instance = new $class($matrix$options);
  91.         return $instance;
  92.     }
  93.     
  94.     /**
  95.      * Set options for this Filler
  96.      *
  97.      * @param array $options Options to set
  98.      * @return void 
  99.      */
  100.     function setOptions($options = array()) {
  101.         $opts array_merge($this->_defaultOptions$options);
  102.         $this->options = $opts;
  103.     }
  104.  
  105.     /**
  106.      * Determine if a given object is a valid H_T_M Filler
  107.      *
  108.      * @param mixed $object Object to check
  109.      * @return boolean true if valid, false otherwise
  110.      */
  111.     function isValid(&$object)
  112.     {
  113.         if (!is_a($object'HTML_Table_Matrix_Filler')) {
  114.             return false;
  115.         }
  116.         return true;
  117.     }
  118.  
  119.     /**
  120.      * Get the next cell.
  121.      *
  122.      * @param int $index Where we're at in the data-set
  123.      * @return array 1-dimensional array in the form of (row, col) containing the
  124.      *                coordinates to put the data for this loop iteration
  125.      */
  126.     function next($index)
  127.     {
  128.         return PEAR::raiseError("Function not implemented.");
  129.     }
  130. }
  131. ?>

Documentation generated on Mon, 11 Mar 2019 15:32:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.