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,v 1.1.1.1 2004/04/19 23:47:14 ieure Exp $
  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.      * Create an instance of a Filler
  68.      *
  69.      * @param string $type Type of filler to instantiate
  70.      * @param Object $matrix Reference to the HTML_Table_Matrix instance
  71.      *                        the Filler will work with
  72.      * @param array $options Filler options
  73.      * @return mixed Filler instance on success, PEAR_Error otherwise
  74.      */
  75.     function &factory($type&$matrix$options = false)
  76.     {
  77.         $class 'HTML_Table_Matrix_Filler_'.$type;
  78.         $file str_replace('_''/'$class).'.php';
  79.         @include_once $file;
  80.         if (!class_exists($class)) {
  81.             return PEAR::raiseError("Filler \"$type\" does not exist.");
  82.         }
  83.         $instance = new $class($matrix$options);
  84.         return $instance;
  85.     }
  86.     
  87.     /**
  88.      * Set options for this Filler
  89.      *
  90.      * @param array $options Options to set
  91.      * @return void 
  92.      */
  93.     function setOptions($options = false{
  94.         $opts array_merge($this->_defaultOptions$options);
  95.         $this->options = $opts;
  96.     }
  97.  
  98.     /**
  99.      * Determine if a given object is a valid H_T_M Filler
  100.      *
  101.      * @param mixed $object Object to check
  102.      * @return boolean true if valid, false otherwise
  103.      */
  104.     function isValid(&$object)
  105.     {
  106.         if (!is_a($object'HTML_Table_Matrix_Filler')) {
  107.             return false;
  108.         }
  109.         return true;
  110.     }
  111.  
  112.     /**
  113.      * Get the next cell.
  114.      *
  115.      * @param int $index Where we're at in the data-set
  116.      * @return array 1-dimensional array in the form of (row, col) containing the
  117.      *                coordinates to put the data for this loop iteration
  118.      */
  119.     function next($index)
  120.     {
  121.         return PEAR::raiseError("Function not implemented.");
  122.     }
  123. }
  124. ?>

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