Exemplo n.º 1
0
 function __construct($c)
 {
     parent::__construct();
     $this->feideconfig = $c;
     $this->fetchOrgInfo();
     $this->getKind();
     $this->addKNR();
     $this->addKommuner();
     // $this->kommuner = array();
     // $this->fylker = array();
     // $this->loadKommuneListe();
     // $this->loadFylkeListe();
     foreach ($this->items as $i) {
         // print_r($i);
         if (isset($i['id'])) {
             $item = FeideOrg::fromDB($i);
             $item->save();
         }
     }
     // echo json_encode($this->items, JSON_PRETTY_PRINT);
     // $this->debug();
 }
Exemplo n.º 2
0
         } else {
             if ($type === 'favs') {
                 $userid = $gk->getUserID();
                 $fav = Favourites::getByID($userid);
                 $col->filterByList($fav->get('favs'));
             } else {
                 if ($type === 'potential') {
                     $col->filterByRealm($realm, false);
                     $col->filterByTarget('other', true);
                 }
             }
         }
     }
     // echo "We found logo " . $parameters[0];
     $response = $col->getView(array('realm' => $realm));
     $response['orgInfo'] = FeideOrg::getByRealm($realm);
 } else {
     if (DiscoUtils::route('get', '^/reviews/([^/]+)$', $parameters, $qs)) {
     } else {
         if (DiscoUtils::route('post', '^/reviews/([^/]+)$', $parameters, $qs)) {
         } else {
             if (DiscoUtils::route('get', '^/favs$', $parameters, $qs)) {
                 $userid = $gk->getUserID();
                 $fav = Favourites::getByID($userid);
                 $data = $fav->getView();
                 if (!empty($data) && isset($data['favs'])) {
                     $response = $data['favs'];
                 } else {
                     $response = array();
                 }
             } else {