Goetas\Xsd\XsdToPhp\Php\ClassGenerator::isOneType PHP Method

isOneType() private method

private isOneType ( PHPClass $type, $onlyParent = false )
$type Goetas\Xsd\XsdToPhp\Php\Structure\PHPClass
    private 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");
            }
        }
    }