code/models/PlaceableObject_Preset.php
public function getSubClassNames()
    {
        $classes = array();
        $killAncestors = array();
        // make it easier to unset values
        foreach(ClassInfo::subclassesFor($this->ClassName) as $class) {
            $classes[$class] = $class;
        }

        unset(
            $classes['PlaceableObject_Preset'],
            $classes['BlockObject_Preset'],
            $classes['RegionObject_Preset']
        );

        // figure out if there are any classes we don't want to appear
        foreach($classes as $class) {
            $instance = singleton($class);

            if($instance instanceof HiddenClass) {
                unset($classes[$class]);
                continue;
            };

            // apply Translatable name
            $classes[$class] = $instance->i18n_singular_name();

            // do any of the progeny want to hide an ancestor?
            if($ancestor_to_hide = $instance->stat('hide_ancestor')) {
                // note for killing later
                $killAncestors[] = $ancestor_to_hide;
            }
        }

        // If any of the descendents don't want any of the elders to show up,
        // cruelly render the elders surplus to requirements
        if($killAncestors) {
            $killAncestors = array_unique($killAncestors);
            foreach($killAncestors as $mark) {
                unset($classes[$mark]);
            }
        }

        return $classes;
    }
public function getSubClassNames()
    {
        $classes = array();
        $killAncestors = array();
        // make it easier to unset values
        foreach(ClassInfo::subclassesFor($this->ClassName) as $class) {
            $classes[$class] = $class;
        }

        unset(
            $classes['PlaceableObject_Preset'],
            $classes['BlockObject_Preset'],
            $classes['RegionObject_Preset']
        );

        // figure out if there are any classes we don't want to appear
        foreach($classes as $class) {
            $instance = singleton($class);

            if($instance instanceof HiddenClass) {
                unset($classes[$class]);
                continue;
            };

            // apply Translatable name
            $classes[$class] = $instance->i18n_singular_name();

            // do any of the progeny want to hide an ancestor?
            if($ancestor_to_hide = $instance->stat('hide_ancestor')) {
                // note for killing later
                $killAncestors[] = $ancestor_to_hide;
            }
        }

        // If any of the descendents don't want any of the elders to show up,
        // cruelly render the elders surplus to requirements
        if($killAncestors) {
            $killAncestors = array_unique($killAncestors);
            foreach($killAncestors as $mark) {
                unset($classes[$mark]);
            }
        }

        return $classes;
    }
public function getSubClassNames ( ) { $ classes = array ( ) ; $ killAncestors = array ( ) ; // make it easier to unset values foreach ( ClassInfo :: subclassesFor ( $ this -> ClassName ) as $ class ) { $ classes [ $ class ] = $ class ; } unset ( $ classes [ 'PlaceableObject_Preset' ] , $ classes [ 'BlockObject_Preset' ] , $ classes [ 'RegionObject_Preset' ] ) ; // figure out if there are any classes we don't want to appear foreach ( $ classes as $ class ) { $ instance = singleton ( $ class ) ; if ( $ instance instanceof HiddenClass ) { unset ( $ classes [ $ class ] ) ; continue ; } ; // apply Translatable name $ classes [ $ class ] = $ instance -> i18n_singular_name ( ) ; // do any of the progeny want to hide an ancestor? if ( $ ancestor_to_hide = $ instance -> stat ( 'hide_ancestor' ) ) { // note for killing later $ killAncestors [ ] = $ ancestor_to_hide ; } } // If any of the descendents don't want any of the elders to show up, // cruelly render the elders surplus to requirements if ( $ killAncestors ) { $ killAncestors = array_unique ( $ killAncestors ) ; foreach ( $ killAncestors as $ mark ) { unset ( $ classes [ $ mark ] ) ; } } return $ classes ; }
Get available sub classes from current class
@return array
Get available sub classes from current class