Source for file Ruleloader.php

Documentation is available at Ruleloader.php

  1. <?php  if defined('BASEPATH')) exit('No direct script access allowed');
  2. /** 
  3.  * Ruleloader.php
  4.  * @author Greg Swindle <greg@swindle.net>
  5.  * @version 0.2
  6.  * @package Phprules
  7.  */
  8.  
  9. /**
  10.  * Loads a Rule from a file. RuleLoader uses the Strategy pattern so you define custom algorithms for loading Rules and RuleContexts.
  11.  * @package Phprules
  12.  */
  13. class RuleLoader {
  14.  /**
  15.  * The algorithm used to retrieve a Rule or RuleContext.
  16.  * @access private
  17.  * @var RuleContextLoaderStrategy 
  18.  */ 
  19.     private $strategy NULL;
  20.  /**
  21.  * @access public
  22.  * @var Rule 
  23.  */     
  24.     public $rule = NULL;
  25.  /**
  26.  * @access public
  27.  * @var RuleContext 
  28.  */     
  29.     public $ruleContext = NULL;
  30.     
  31.     public function __construct(){
  32.         $this->rule = new Rule();
  33.         $this->ruleContext = new RuleContext();
  34.     }
  35.     
  36.     public function setStrategy$strategy {
  37.         $this->strategy $strategy;
  38.         $strategy->rule $this->rule;
  39.         $strategy->ruleContext $this->ruleContext;
  40.     }
  41.     
  42.     public function loadRule$fileName {
  43.         return $this->strategy->loadRule$fileName );        
  44.     }
  45.     
  46.     public function loadRuleContext$fileName$id {
  47.         return $this->strategy->loadRuleContext$fileName$id );
  48.     }
  49. }
  50.  
  51. /* End of file Ruleloader.php */
  52. /* Location: ./system/application/libraries/php-rules/Ruleloader.php */

Documentation generated on Thu, 24 Mar 2011 21:27:42 -0500 by phpDocumentor 1.4.1