src/Writer/MzIdentMlWriter.php
public function addCv($name, $version, $uri, $cvRef)
    {
        $this->cvList[] = array(
            'fullName' => $name,
            'version' => $version,
            'uri' => $uri,
            'id' => $cvRef
        );

        // read in obo file
        $handle = fopen($uri, 'r');
        $lineReader = new LineReader($handle);
        // parse file
        $parser = new Parser($lineReader);
        $parser->retainTrailingComments(true);
        $parser->getDocument()->mergeStanzas(false); // speed tip
        $parser->parse();

        $terms = array();
        foreach ($parser->getDocument()->getStanzas('Term') as $term) {
            $id = $term->get('id');
            $name = $term->get('name');

            $terms[$id] = $name;
        }

        $this->oboRef[$cvRef] = $terms;
    }
public function addCv($name, $version, $uri, $cvRef)
    {
        $this->cvList[] = array(
            'fullName' => $name,
            'version' => $version,
            'uri' => $uri,
            'id' => $cvRef
        );

        // read in obo file
        $handle = fopen($uri, 'r');
        $lineReader = new LineReader($handle);
        // parse file
        $parser = new Parser($lineReader);
        $parser->retainTrailingComments(true);
        $parser->getDocument()->mergeStanzas(false); // speed tip
        $parser->parse();

        $terms = array();
        foreach ($parser->getDocument()->getStanzas('Term') as $term) {
            $id = $term->get('id');
            $name = $term->get('name');

            $terms[$id] = $name;
        }

        $this->oboRef[$cvRef] = $terms;
    }
public function addCv ( $ name , $ version , $ uri , $ cvRef ) { $ this -> cvList [ ] = array ( 'fullName' => $ name , 'version' => $ version , 'uri' => $ uri , 'id' => $ cvRef ) ; // read in obo file $ handle = fopen ( $ uri , 'r' ) ; $ lineReader = new LineReader ( $ handle ) ; // parse file $ parser = new Parser ( $ lineReader ) ; $ parser -> retainTrailingComments ( true ) ; $ parser -> getDocument ( ) -> mergeStanzas ( false ) ; // speed tip $ parser -> parse ( ) ; $ terms = array ( ) ; foreach ( $ parser -> getDocument ( ) -> getStanzas ( 'Term' ) as $ term ) { $ id = $ term -> get ( 'id' ) ; $ name = $ term -> get ( 'name' ) ; $ terms [ $ id ] = $ name ; } $ this -> oboRef [ $ cvRef ] = $ terms ; }
CV terms must be added prior to open being called

@param string $name
@param string $version
@param string $uri
@param string $id
CV terms must be added prior to open being called