当前位置: 首页>>代码示例>>PHP>>正文


PHP Registration::get方法代码示例

本文整理汇总了PHP中Registration::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::get方法的具体用法?PHP Registration::get怎么用?PHP Registration::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Registration的用法示例。


在下文中一共展示了Registration::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCurrentRegistration

 public function getCurrentRegistration()
 {
     $member = Member::currentUser();
     if (!$member) {
         return false;
     }
     $reg = Registration::get()->filter(array('MemberID' => $member->ID, 'ParentID' => $this->getCurrentEvent()->ID));
     if (!$reg) {
         return false;
     }
     return $reg->First();
 }
开发者ID:adrexia,项目名称:chimera,代码行数:12,代码来源:Page.php

示例2: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Sort');
     $siteConfig = SiteConfig::current_site_config();
     $current = $siteConfig->getCurrentEventID();
     if ($this->Event()->ID) {
         $event = $this->Event();
     } else {
         if ($this->Parent()->ParentID > 0) {
             $event = Event::get()->byID($this->Parent()->ParentID);
         } else {
             $event = Event::get()->byID($current);
         }
     }
     if ($event) {
         $prefNum = $event->PreferencesPerSession ? $event->PreferencesPerSession : 2;
     } else {
         $prefNum = 2;
     }
     $pref = array();
     for ($i = 1; $i <= $prefNum; $i++) {
         $pref[$i] = $i;
     }
     $preference = new DropdownField('Preference', 'Preference', $pref);
     $preference->setEmptyString(' ');
     $fields->insertAfter($preference, 'GameID');
     $status = array(0 => "Pending/Declined", 1 => "Accepted");
     $fields->insertAfter(new OptionsetField('Status', 'Status', $status), 'Preference');
     $reg = Registration::get()->filter(array('ParentID' => $event->ID))->map('ID', "Title");
     $player = new DropdownField('ParentID', 'Player', $reg);
     $player->setEmptyString(' ');
     $fields->insertAfter($player, 'Status');
     $fields->insertAfter($fields->dataFieldByName('Favourite'), 'Status');
     $fields->insertAfter($fields->dataFieldByName('ParentID'), 'GameID');
     $event = HiddenField::create('EventID', 'Event', $event->ID);
     $fields->insertAfter($event, 'GameID');
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:adrexia-gamesevent,代码行数:39,代码来源:PlayerGame.php

示例3: function

<?php

View::composer(array('home', 'registrations.register'), function ($view) {
    $all = Registration::get()->sum('tickets');
    $today = Registration::where(DB::raw('DATE(registrations.created_at)'), DB::raw('CURDATE()'))->get()->sum('tickets');
    $expected = Booking::get()->sum('tickets');
    $view->with('registration_count_total', $all)->with('registration_count_today', $today)->with('expected_count', $expected);
});
开发者ID:ajwgibson,项目名称:illuminate,代码行数:8,代码来源:composers.php

示例4: getRegistrations

 function getRegistrations($callsign = null)
 {
     if (is_null($this->registrations)) {
         $this->registrations = Registration::get()->each(function ($registration) {
             $registration->prefix = str_replace('-', '', $registration->prefix);
             if (!$registration->regex) {
                 $registration->prefix .= '.*';
             }
         });
     }
     if (!is_null($callsign)) {
         return $this->registrations->first(function ($key, $registration) use($callsign) {
             return preg_match('/^' . $registration->prefix . '$/', $callsign);
         });
     }
     return $this->registrations;
 }
开发者ID:T-SummerStudent,项目名称:new,代码行数:17,代码来源:LegacyUpdate.php

示例5: getRegistration

 public function getRegistration($memberID)
 {
     $siteConfig = SiteConfig::current_site_config();
     return Registration::get()->filter(array("MemberID" => $memberID, 'ParentID' => $siteConfig->CurrentEventID))->First();
 }
开发者ID:helpfulrobot,项目名称:adrexia-gamesevent,代码行数:5,代码来源:RegistrationPage.php

示例6: addPlayerGame

 /**
  * Attempts to save a game
  *
  * @return Game|null
  */
 protected function addPlayerGame($data, $form)
 {
     $fields = $form->Fields();
     $event = $this->getCurrentEvent();
     $currentID = $event->ID;
     $prefNum = $event->PreferencesPerSession;
     $regID = $data['RegistrationID'];
     $reg = Registration::get()->byID($regID);
     if (!$reg) {
         return false;
     }
     // @todo - handle a proper 'change game' case
     if ($reg->PlayerGames()->Count() > 0) {
         foreach ($reg->PlayerGames() as $playerGame) {
             $reg->PlayerGames()->removeByID($playerGame->ID);
             $playerGame->delete();
         }
     }
     $favouriteID = $data["FavouriteID"];
     for ($session = 1; $session <= $event->NumberOfSessions; $session++) {
         $notPlay = $data["NotPlaying_" . $session];
         $games = Game::get()->filter(array('Session' => $session, 'ParentID' => $currentID, 'Status' => true));
         // Alter prefnumber so it stops when it encounters "not Playing"
         if ($notPlay != 0 && $notPlay < $prefNum) {
             $prefNum = $notPlay;
         }
         // if first choice is to not play, don't create any games
         if ($notPlay === 1) {
             continue;
         }
         foreach ($games as $game) {
             $gamePref = $data["GameID_" . $game->ID];
             // only store games with a preference higher than our threshold
             if ($gamePref > $prefNum || !isset($gamePref)) {
                 continue;
             }
             $playerGame = PlayerGame::create();
             $form->saveInto($playerGame);
             $playerGame->GameID = $game->ID;
             $playerGame->ParentID = $regID;
             $playerGame->Preference = $gamePref;
             if ($favouriteID == $game->ID) {
                 $playerGame->Favourite = true;
             }
             try {
                 $playerGame->write();
             } catch (ValidationException $e) {
                 $form->sessionMessage($e->getResult()->message(), 'bad');
                 return;
             }
         }
     }
     return $playerGame;
 }
开发者ID:helpfulrobot,项目名称:adrexia-gamesevent,代码行数:59,代码来源:GameSignupPage.php

示例7: prepareDatabase

 protected function prepareDatabase()
 {
     // Get database records for all airlines, airports, registrations
     $this->airlines = Airline::get();
     $this->registrations = Registration::get()->each(function ($registration) {
         $registration->prefix = str_replace('-', '', $registration->prefix);
         if (!$registration->regex) {
             $registration->prefix .= '.*';
         }
     });
 }
开发者ID:T-SummerStudent,项目名称:new,代码行数:11,代码来源:VatawareUpdateCommand.php


注:本文中的Registration::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。