public function getBaseComponents($componentName = null)
    {
        $isBaseComponent = function ($component) {
            if (!$component instanceof VObject\Component) {
                return false;
            }
            if ('VTIMEZONE' === $component->name) {
                return false;
            }
            if (isset($component->{'RECURRENCE-ID'})) {
                return false;
            }

            return true;
        };

        if ($componentName) {
            // Early exit
            return array_filter(
                $this->select($componentName),
                $isBaseComponent
            );
        }

        $components = [];
        foreach ($this->children as $childGroup) {
            foreach ($childGroup as $child) {
                if (!$child instanceof Component) {
                    // If one child is not a component, they all are so we skip
                    // the entire group.
                    continue 2;
                }
                if ($isBaseComponent($child)) {
                    $components[] = $child;
                }
            }
        }

        return $components;
    }
public function getBaseComponents($componentName = null)
    {
        $isBaseComponent = function ($component) {
            if (!$component instanceof VObject\Component) {
                return false;
            }
            if ('VTIMEZONE' === $component->name) {
                return false;
            }
            if (isset($component->{'RECURRENCE-ID'})) {
                return false;
            }

            return true;
        };

        if ($componentName) {
            // Early exit
            return array_filter(
                $this->select($componentName),
                $isBaseComponent
            );
        }

        $components = [];
        foreach ($this->children as $childGroup) {
            foreach ($childGroup as $child) {
                if (!$child instanceof Component) {
                    // If one child is not a component, they all are so we skip
                    // the entire group.
                    continue 2;
                }
                if ($isBaseComponent($child)) {
                    $components[] = $child;
                }
            }
        }

        return $components;
    }
public function getBaseComponents ( $ componentName = null ) { $ isBaseComponent = function ( $ component ) { if ( ! $ component instanceof VObject \ Component ) { return false ; } if ( 'VTIMEZONE' === $ component -> name ) { return false ; } if ( isset ( $ component -> { 'RECURRENCE-ID' } ) ) { return false ; } return true ; } ; if ( $ componentName ) { // Early exit return array_filter ( $ this -> select ( $ componentName ) , $ isBaseComponent ) ; } $ components = [ ] ; foreach ( $ this -> children as $ childGroup ) { foreach ( $ childGroup as $ child ) { if ( ! $ child instanceof Component ) { // If one child is not a component, they all are so we skip // the entire group. continue 2 ; } if ( $ isBaseComponent ( $ child ) ) { $ components [ ] = $ child ; } } } return $ components ; }
Returns a list of all 'base components'. For instance, if an Event has
a recurrence rule, and one instance is overridden, the overridden event
will have the same UID, but will be excluded from this list.

VTIMEZONE components will always be excluded.

@param string $componentName filter by component name

@return VObject\Component[]
Returns a list of all base components . For instance if an Event has a recurrence rule and one instance is overridden the overridden event will have the same UID but will be excluded from this list .