protected function getPortableFactory()
 {
     return PortableModelRegistry::getRegistry();
 }
 public function __invoke($params)
 {
     PortableModelRegistry::getRegistry()->register(new PciModel());
     return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, 'Pci Model successfully registered.');
 }
Ejemplo n.º 3
0
 /**
  * Parse and build a info control
  * 
  * @param DOMElement $data
  * @return InfoControl
  * @throws ParsingException
  */
 private function buildInfoControl(DOMElement $data)
 {
     $infoControl = null;
     if ($this->isPicNode($data)) {
         // throws an exception if pic not present
         PortableModelRegistry::getRegistry()->getModel('PIC');
         //use tao's implementation of portable custom interaction
         $infoControl = new PortableInfoControl($this->extractAttributes($data), $this->item);
         $infoControl->feed($this, $data);
     } else {
         $ciClass = '';
         $classes = $data->getAttribute('class');
         $classeNames = preg_split('/\\s+/', $classes);
         foreach ($classeNames as $classeName) {
             $ciClass = InfoControlRegistry::getInfoControlByName($classeName);
             if ($ciClass) {
                 $infoControl = new $ciClass($this->extractAttributes($data), $this->item);
                 $infoControl->feed($this, $data);
                 break;
             }
         }
         if (!$ciClass) {
             throw new UnsupportedQtiElement($data);
         }
     }
     return $infoControl;
 }