Goetas\Xsd\XsdToPhp\Php\Structure\PHPClass::getPropertiesInHierarchy PHP Method

getPropertiesInHierarchy() public method

public getPropertiesInHierarchy ( ) : Goetas\Xsd\XsdToPhp\Php\Structure\PHPProperty
return Goetas\Xsd\XsdToPhp\Php\Structure\PHPProperty
    public function getPropertiesInHierarchy()
    {
        $ps = $this->getProperties();
        if ($this instanceof PHPClass && $this->getExtends()) {
            $ps = array_merge($ps, $this->getExtends()->getPropertiesInHierarchy());
        }
        return $ps;
    }

Usage Example

Exemplo n.º 1
0
 protected function isOneType(PHPClass $type, $onlyParent = false)
 {
     if ($onlyParent) {
         $e = $type->getExtends();
         if ($e) {
             if ($e->hasProperty('__value')) {
                 return $e->getProperty('__value');
             }
         }
     } else {
         if ($type->hasPropertyInHierarchy('__value') && count($type->getPropertiesInHierarchy()) === 1) {
             return $type->getPropertyInHierarchy("__value");
         }
     }
 }