@@ -52,39 +52,47 @@ public function getList()
52
52
53
53
$ result = array ();
54
54
foreach ($ twitters as $ twitter ) {
55
- $ group = $ twitter ->getGroup ();
56
- if (!$ group ) {
57
- continue ;
58
- }
59
- if (! $ group instanceof Usergroup) {
60
- continue ;
61
- }
62
- if ($ group ->getState () != Usergroup::ACTIVE ) {
63
- continue ;
64
- }
65
- if (! isset ($ result [$ twitter ->getName ()])) {
66
- $ result [$ twitter ->getName ()] = array (
67
- 'screen_name ' => $ twitter ->getName (),
68
- 'name ' => $ twitterService ->getInfoForUser ('name ' , $ twitter ->getName ()),
69
- 'url ' => $ twitter ->getUrl (),
70
- 'icon_url ' => $ twitterService ->getInfoForUser ('profile_image_url_https ' , $ twitter ->getName ()),
71
- 'groups ' => array (),
72
- );
73
- }
74
- $ groupMapUrl = $ this ->url ()->fromRoute ('home ' , array (), array ('force_canonical ' => true )) . '?center= ' . $ group ->getShortName ();
75
- $ groupApiUrl = $ this ->url ()->fromRoute (
76
- 'api/rest ' , array (
55
+ try {
56
+ $ group = $ twitter ->getGroup ();
57
+ if (! $ group ) {
58
+ continue ;
59
+ }
60
+ if (! $ group instanceof Usergroup) {
61
+ continue ;
62
+ }
63
+ if ($ group ->getState () != Usergroup::ACTIVE ) {
64
+ continue ;
65
+ }
66
+ if (! isset ($ result [$ twitter ->getName ()])) {
67
+ $ result [$ twitter ->getName ()] = array (
68
+ 'screen_name ' => $ twitter ->getName (),
69
+ 'name ' => $ twitterService ->getInfoForUser ('name ' ,
70
+ $ twitter ->getName ()),
71
+ 'url ' => $ twitter ->getUrl (),
72
+ 'icon_url ' => $ twitterService ->getInfoForUser ('profile_image_url_https ' ,
73
+ $ twitter ->getName ()),
74
+ 'groups ' => array (),
75
+ );
76
+ }
77
+ $ groupMapUrl = $ this ->url ()->fromRoute ('home ' ,
78
+ array (),
79
+ array ('force_canonical ' => true )) . '?center= ' . $ group ->getShortName ();
80
+ $ groupApiUrl = $ this ->url ()->fromRoute (
81
+ 'api/rest ' , array (
77
82
'controller ' => 'Usergroup ' ,
78
- 'id ' => $ group ->getId (),
83
+ 'id ' => $ group ->getId (),
79
84
),
80
- array ('force_canonical ' => true )
81
- );
82
- $ result [$ twitter ->getName ()]['groups ' ][] = array (
83
- 'usergroup ' => $ group ->getName (),
84
- 'usergroup_url ' => $ group ->getUrl (),
85
- 'phpug_group_map_url ' => $ groupMapUrl ,
86
- 'phpug_group_api_url ' => $ groupApiUrl ,
87
- );
85
+ array ('force_canonical ' => true )
86
+ );
87
+ $ result [$ twitter ->getName ()]['groups ' ][] = array (
88
+ 'usergroup ' => $ group ->getName (),
89
+ 'usergroup_url ' => $ group ->getUrl (),
90
+ 'phpug_group_map_url ' => $ groupMapUrl ,
91
+ 'phpug_group_api_url ' => $ groupApiUrl ,
92
+ );
93
+ } catch (\Exception $ e ) {
94
+
95
+ }
88
96
}
89
97
90
98
usort ($ result , function ($ a , $ b ){
0 commit comments