private function getFiltered(bool $public = true): array
    {
        $result = [];
        foreach ($this->events as $event) {
            if ($event['is_public'] === $public) {
                $result[] = $event;
            }
        }
        return $result;
    }
private function getFiltered(bool $public = true): array
    {
        $result = [];
        foreach ($this->events as $event) {
            if ($event['is_public'] === $public) {
                $result[] = $event;
            }
        }
        return $result;
    }
private function getFiltered ( bool $ public = true ) : array { $ result = [ ] ; foreach ( $ this -> events as $ event ) { if ( $ event [ 'is_public' ] === $ public ) { $ result [ ] = $ event ; } } return $ result ; }
Returns array with events filtered by event's visibility

@param bool $public
@return array
Returns array with events filtered by event s visibility