class SearchIntrospection (View source)

Some additional introspection tools that are used often by the fulltext search code

Properties

protected static $ancestry
protected static $hierarchy

Methods

public static 
bool
is_subclass_of($class, $of)

Check if class is subclass of (a) the class in $of, or (b) any of the classes in the array $of

public static 
array
hierarchy(string $class, bool $includeSubclasses = true, bool $dataOnly = false)

Get all the classes involved in a DataObject hierarchy - both super and optionally subclasses

public static 
add_unique_by_ancestor($list, $class)

Add classes to list, keeping only the parent when parent & child are both in list after add

public static 
has_extension($class, $extension, $includeSubclasses = true)

Does this class, it's parent (or optionally one of it's children) have the passed extension attached?

Details

static bool is_subclass_of($class, $of)

Check if class is subclass of (a) the class in $of, or (b) any of the classes in the array $of

Parameters

$class
$of

Return Value

bool

static array hierarchy(string $class, bool $includeSubclasses = true, bool $dataOnly = false)

Get all the classes involved in a DataObject hierarchy - both super and optionally subclasses

Parameters

string $class
  • The class to query
bool $includeSubclasses
  • True to return subclasses as well as super classes
bool $dataOnly
  • True to only return classes that have tables

Return Value

array
  • Integer keys, String values as classes sorted by depth (most super first)

static add_unique_by_ancestor($list, $class)

Add classes to list, keeping only the parent when parent & child are both in list after add

Parameters

$list
$class

static has_extension($class, $extension, $includeSubclasses = true)

Does this class, it's parent (or optionally one of it's children) have the passed extension attached?

Parameters

$class
$extension
$includeSubclasses