HTMLPurifier 4.4.0
/home/ezyang/Dev/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php
Go to the documentation of this file.
00001 <?php
00002 
00008 class HTMLPurifier_ConfigSchema_Interchange
00009 {
00010 
00014     public $name;
00015 
00019     public $directives = array();
00020 
00024     public function addDirective($directive) {
00025         if (isset($this->directives[$i = $directive->id->toString()])) {
00026             throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'");
00027         }
00028         $this->directives[$i] = $directive;
00029     }
00030 
00035     public function validate() {
00036         $validator = new HTMLPurifier_ConfigSchema_Validator();
00037         return $validator->validate($this);
00038     }
00039 
00040 }
00041 
00042 // vim: et sw=4 sts=4