ARC2::getComponent PHP Method

getComponent() static public method

*
static public getComponent ( $name, $a = '', $caller = '' )
    static function getComponent($name, $a = '', $caller = '')
    {
        ARC2::inc($name);
        $prefix = 'ARC2';
        if (preg_match('/^([^\\_]+)\\_(.+)$/', $name, $m)) {
            $prefix = $m[1];
            $name = $m[2];
        }
        $cls = $prefix . '_' . $name;
        if (!$caller) {
            $caller = new stdClass();
        }
        return new $cls($a, $caller);
    }

Usage Example

Example #1
0
 function getANodeNeg()
 {
     $conf = array('ns' => array('rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', 'dbpedia' => 'http://dbpedia.org/ontology/', 'foaf' => 'http://xmlns.com/foaf/0.1/', 'xsd' => 'http://www.w3.org/2001/XMLSchema#', 'dcterms' => 'http://purl.org/dc/terms/'));
     $docNeg = $this->getDOMDocNeg();
     $aNodes = $docNeg->source->getElementsByTagName('a');
     $conf['source'] = $aNodes->item(0);
     return ARC2::getComponent('negotiators_ANodePlugin', $conf);
 }
All Usage Examples Of ARC2::getComponent