src/Reader/HupoPsi/PsiXmlTrait.php
protected function getCvParam($xml)
    {
        $cvParam = array();
        // Required fields

        $cvParam['cvRef'] = (string) $xml->attributes()->cvRef;
        $cvParam[PsiVerb::CV_ACCESSION] = (string) $xml->attributes()->accession;
        $cvParam[PsiVerb::CV_NAME] = (string) $xml->attributes()->name;

        if (! isset($this->cvParamIndex[$cvParam[PsiVerb::CV_ACCESSION]])) {
            $this->cvParamIndex[$cvParam[PsiVerb::CV_ACCESSION]] = $cvParam['name'];
        }

        // Optional fields
        if (isset($xml->attributes()->value)) {
            $cvParam[PsiVerb::CV_VALUE] = (string) $xml->attributes()->value;
        }

        if (isset($xml->attributes()->unitAccession)) {
            $cvParam[PsiVerb::CV_UNITACCESSION] = (string) $xml->attributes()->unitAccession;
        }

        if (isset($xml->attributes()->unitName)) {
            $cvParam['unitName'] = (string) $xml->attributes()->unitName;
        }

        if (isset($xml->attributes()->unitCvRef)) {
            $cvParam['unitCvRef'] = (string) $xml->attributes()->unitCvRef;
        }

        return $cvParam;
    }
protected function getCvParam($xml)
    {
        $cvParam = array();
        // Required fields

        $cvParam['cvRef'] = (string) $xml->attributes()->cvRef;
        $cvParam[PsiVerb::CV_ACCESSION] = (string) $xml->attributes()->accession;
        $cvParam[PsiVerb::CV_NAME] = (string) $xml->attributes()->name;

        if (! isset($this->cvParamIndex[$cvParam[PsiVerb::CV_ACCESSION]])) {
            $this->cvParamIndex[$cvParam[PsiVerb::CV_ACCESSION]] = $cvParam['name'];
        }

        // Optional fields
        if (isset($xml->attributes()->value)) {
            $cvParam[PsiVerb::CV_VALUE] = (string) $xml->attributes()->value;
        }

        if (isset($xml->attributes()->unitAccession)) {
            $cvParam[PsiVerb::CV_UNITACCESSION] = (string) $xml->attributes()->unitAccession;
        }

        if (isset($xml->attributes()->unitName)) {
            $cvParam['unitName'] = (string) $xml->attributes()->unitName;
        }

        if (isset($xml->attributes()->unitCvRef)) {
            $cvParam['unitCvRef'] = (string) $xml->attributes()->unitCvRef;
        }

        return $cvParam;
    }
protected function getCvParam ( $ xml ) { $ cvParam = array ( ) ; // Required fields $ cvParam [ 'cvRef' ] = ( string ) $ xml -> attributes ( ) -> cvRef ; $ cvParam [ PsiVerb :: CV_ACCESSION ] = ( string ) $ xml -> attributes ( ) -> accession ; $ cvParam [ PsiVerb :: CV_NAME ] = ( string ) $ xml -> attributes ( ) -> name ; if ( ! isset ( $ this -> cvParamIndex [ $ cvParam [ PsiVerb :: CV_ACCESSION ] ] ) ) { $ this -> cvParamIndex [ $ cvParam [ PsiVerb :: CV_ACCESSION ] ] = $ cvParam [ 'name' ] ; } // Optional fields if ( isset ( $ xml -> attributes ( ) -> value ) ) { $ cvParam [ PsiVerb :: CV_VALUE ] = ( string ) $ xml -> attributes ( ) -> value ; } if ( isset ( $ xml -> attributes ( ) -> unitAccession ) ) { $ cvParam [ PsiVerb :: CV_UNITACCESSION ] = ( string ) $ xml -> attributes ( ) -> unitAccession ; } if ( isset ( $ xml -> attributes ( ) -> unitName ) ) { $ cvParam [ 'unitName' ] = ( string ) $ xml -> attributes ( ) -> unitName ; } if ( isset ( $ xml -> attributes ( ) -> unitCvRef ) ) { $ cvParam [ 'unitCvRef' ] = ( string ) $ xml -> attributes ( ) -> unitCvRef ; } return $ cvParam ; }
Creates an array object from a CvParam object

@param \SimpleXMLElement $xml
Creates an array object from a CvParam object