Gets the first descendant UI-object of a specific class

@param string $class_name class name to look for.

@return SwatUIObject the first descendant UI-object or null if no
matching descendant is found.

@see SwatUIParent::getFirstDescendant()
328865
public function getFirstDescendant($class_name)
    {
        if (!class_exists($class_name) && !interface_exists($class_name)) {
            return null;
        }

        $out = null;

        foreach ($this->fields as $field) {
            if ($field instanceof $class_name) {
                $out = $field;
                break;
            }

            if ($field instanceof SwatUIParent) {
                $out = $field->getFirstDescendant($class_name);
                if ($out !== null) {
                    break;
                }
            }
        }

        return $out;
    }
564120
public function get($property_name) {
    if ($property_name === 'entity' && !isset($this->values[$property_name])) {
      $value = $this->values[$property_name] = SKU::loadFromSku($this->values['value'], $this->getLangcode());
      $this->properties[$property_name] = $this->getTypedDataManager()->getPropertyInstance($this, $property_name, $value);
    }
    return parent::get($property_name);
  }
267814
public function fetchFirstObj(string $class = null): ?object
    {
        if ($class == null && $this->modelClass !== null) {
            return parent::fetchFirstObj($this->modelClass);
        } else {
            return parent::fetchFirstObj($class);
        }
    }
1135783
public function getFirstChildNode(...$classNames) {
        foreach ($this::CHILD_NAMES as $name) {
            $val = $this->$name;
            foreach ($classNames as $className) {
                if (\is_array($val)) {
                    foreach ($val as $child) {
                        if ($child instanceof $className) {
                            return $child;
                        }
                    }
                    continue;
                } elseif ($val instanceof $className) {
                    return $val;
                }
            }
        }
        return null;
    }
797064
public function getTemplateObject($_type, $_ref = null)
    {
        $stack_name = !is_null($_ref) ? $_ref : $this->getTemplateObjectClassName($_type);

        if (!$this->registry->isEntry($stack_name, 'template_objects')) {
            $this->createNewTemplateObject($_type, $_ref);
        }

        return $this->registry->getEntry($stack_name, 'template_objects');
    }
387579
public static function get_namespace($class_name)
	{
		$class_name = trim($class_name, '\\');
		if ($last_separator = strrpos($class_name, '\\'))
		{
			return substr($class_name, 0, $last_separator + 1);
		}
		return '';
	}
541011
def descendant_get(desc_name)
      return self if desc_name == name || desc_name.nil?
      klass = descendants.find { |desc| desc.name == desc_name }
      raise ArgumentError, "#{desc_name} is not a descendant of #{name}" unless klass
      klass
    end
476574
public function getInstance(string $class, $element_id)
    {
        if (!is_a($class, Hierarchy::class, true))
            throw new TypeError("Not a subclass of Hierarchy: $class");

        if (is_object($element_id) && get_class($element_id) === $class)
            return $element_id;

        if (!is_scalar($element_id))
            throw new TypeError("Element-ID must be a scalar");

        if (!$this->hasInstance($class, $element_id))
        {
            $root = $class::getRootName();
            if ($element_id === $root)
                $this->hierarchy[$class][$root] = new $class($this, $root);
            else
                throw new Exception("Element-ID '{$element_id}' is unknown for {$class}");
        }

        return $this->hierarchy[$class][$element_id];
    }
83159
public function getFirstAncestor(...$classNames) {
        $ancestor = $this;
        while (($ancestor = $ancestor->parent) !== null) {
            foreach ($classNames as $className) {
                if ($ancestor instanceof $className) {
                    return $ancestor;
                }
            }
        }
        return null;
    }
734979
public function first(): ?\stdClass
    {
        $pdoStatement = $this->provideStatement();
        $pdoStatement = $this->execute($pdoStatement);
        $row = $pdoStatement->fetch(\PDO::FETCH_OBJ);
        return (!empty($row)) ? $row : null;
    }
1007063
public function getFirst()
    {
        $this->internalDataListUpdate();
        if (isset($this->internalDataListData[0])) {
            return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, 0);
        }
        return null;
    }
1116759
public function findReferencesToClassLike($fq_class_name)
    {
        $fq_class_name_lc = strtolower($fq_class_name);
        $locations = $this->file_reference_provider->getClassLocations($fq_class_name_lc);

        if (isset($this->use_referencing_locations[$fq_class_name_lc])) {
            $locations = array_merge($locations, $this->use_referencing_locations[$fq_class_name_lc]);
        }

        return $locations;
    }
442227
public function fetchObject($class_name = 'stdClass', array $ctor_args = array()) {
		$obj = $this->fetch(PDO::FETCH_OBJ);
		if($class_name == 'stdClass') {
			$res = $obj;
		}
		else {
			$res = $this->populateObject($obj, $class_name, $ctor_args);
		}

		return $res;
	}
1163698
public static function Get ($const_name, $default_value = NULL, $undefined_exception = FALSE) {
		$separator_pos = Strings::RearPosition($const_name, '::');
		if ($separator_pos && !class_exists(Strings::Substring($const_name, 0, $separator_pos), TRUE) && $undefined_exception) {
			throw CoreException::RaiseSystemError('存在しないクラスが設定されています。const name:%s', [$const_name]);
		}
		if (!defined($const_name)) {
			if ($undefined_exception) {
				throw CoreException::RaiseSystemError('存在しない定数名が設定されています。const name:%s', [$const_name]);
			}
			return $default_value;
		}
		return constant($const_name);
	}
1072141
public function getFirstByNameType( $name, $type, $config = [] ) {

		$modelClass = static::$modelClass;

		return $modelClass::findFirstByNameType( $name, $type, $config );
	}
1167964
public static function GetIterator ($name = null) {
		$name = $name ?: \ickx\fw2\core\log\Caller::GetClassMethod();
		if (!isset(static::$_queueList[$name])) {
			static::$_queueList[$name] = new \ArrayObject();
		}
		return static::$_queueList[$name]->getIterator();
	}
673259
public static function isInstanceOf($class_name) {
    $classes = func_get_args();

    return function ($node) use ($classes) {
      foreach ($classes as $class) {
        if ($node instanceof $class) {
          return TRUE;
        }
      }
      return FALSE;
    };
  }