Example #1
0
 protected function addType(parser\type $type)
 {
     $sNamespace = $type->getNamespace();
     if (!array_key_exists($sNamespace, $this->aTypes)) {
         $this->aTypes[$sNamespace] = array();
     }
     $this->aTypes[$sNamespace][$type->getName()] = $type;
     //$type->setNamespaces($this->getNS());
     return $type;
 }
Example #2
0
 protected function getWeightType(schema_ns\parser\type $type)
 {
     $iResult = 0;
     if ($this->getMatch()) {
         $aTypes = array_reverse($type->getBases());
         $aTypes[] = $type;
         $aNames = $this->getMatch();
         foreach ($aNames as $aName) {
             foreach ($aTypes as $subtype) {
                 $iMatch = $this->getWeightSingleName($aName, $subtype->getNamespace(), $subtype->getName(), self::WEIGHT_TYPE, self::WEIGHT_TYPE_NS, self::WEIGHT_TYPE_ALL);
                 if ($iMatch > $iResult) {
                     $iResult = $iMatch;
                 }
             }
         }
     }
     return $iResult;
 }