src/Core/ClassInfo.php
public static function dataClassesFor($nameOrObject)
    {
        if (is_string($nameOrObject) && !class_exists($nameOrObject)) {
            return [];
        }

        // Get all classes
        $class = self::class_name($nameOrObject);
        $classes = array_merge(
            self::ancestry($class),
            self::subclassesFor($class)
        );

        // Filter by table
        return array_filter($classes, function ($next) {
            return DataObject::getSchema()->classHasTable($next);
        });
    }
public static function dataClassesFor($nameOrObject)
    {
        if (is_string($nameOrObject) && !class_exists($nameOrObject)) {
            return [];
        }

        // Get all classes
        $class = self::class_name($nameOrObject);
        $classes = array_merge(
            self::ancestry($class),
            self::subclassesFor($class)
        );

        // Filter by table
        return array_filter($classes, function ($next) {
            return DataObject::getSchema()->classHasTable($next);
        });
    }
public static function dataClassesFor ( $ nameOrObject ) { if ( is_string ( $ nameOrObject ) && ! class_exists ( $ nameOrObject ) ) { return [ ] ; } // Get all classes $ class = self :: class_name ( $ nameOrObject ) ; $ classes = array_merge ( self :: ancestry ( $ class ) , self :: subclassesFor ( $ class ) ) ; // Filter by table return array_filter ( $ classes , function ( $ next ) { return DataObject :: getSchema ( ) -> classHasTable ( $ next ) ; } ) ; }
Returns an array of the current class and all its ancestors and children
which require a DB table.

@todo Move this into {@see DataObjectSchema}

@param string|object $nameOrObject Class or object instance
@return array
Returns an array of the current class and all its ancestors and children which require a DB table .