當前位置: 首頁>>代碼示例>>PHP>>正文


PHP School::SetId方法代碼示例

本文整理匯總了PHP中School::SetId方法的典型用法代碼示例。如果您正苦於以下問題:PHP School::SetId方法的具體用法?PHP School::SetId怎麽用?PHP School::SetId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在School的用法示例。


在下文中一共展示了School::SetId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: BuildPostedDataObject

 /**
  * @return void
  * @desc Re-build from data posted by this control the data object this control is editing
  */
 public function BuildPostedDataObject()
 {
     $school = new School($this->GetSettings());
     if (isset($_POST['item'])) {
         $school->SetId($_POST['item']);
     }
     $school->SetName($_POST['school-name'] . ", " . $_POST["town"]);
     $school->Ground()->SetId($_POST['ground-id']);
     $address = new PostalAddress();
     $address->SetPaon($_POST['school-name']);
     $address->SetStreetDescriptor($_POST['street']);
     $address->SetLocality($_POST['locality']);
     $address->SetTown($_POST['town']);
     $address->SetAdministrativeArea($_POST['county']);
     $address->SetPostcode($_POST['postcode']);
     $address->SetGeoLocation($_POST['latitude'], $_POST['longitude'], $_POST['geoprecision']);
     $school->Ground()->SetAddress($address);
     $this->SetDataObject($school);
 }
開發者ID:stoolball-england,項目名稱:stoolball-england-website,代碼行數:23,代碼來源:edit-school-control.class.php

示例2: BuildItems

 /**
  * Populates the collection of business objects from raw data
  *
  * @return bool
  * @param MySqlRawData $result
  */
 protected function BuildItems(MySqlRawData $result)
 {
     # use CollectionBuilder to handle duplicates
     $school_builder = new CollectionBuilder();
     $school = null;
     while ($row = $result->fetch()) {
         # check whether this is a new school
         if (!$school_builder->IsDone($row->club_id)) {
             # store any exisiting school
             if ($school != null) {
                 $this->Add($school);
             }
             # create the new school
             $school = new School($this->GetSettings());
             $school->SetId($row->club_id);
             $school->SetName($row->club_name);
             $school->SetTypeOfClub($row->club_type);
             $school->SetHowManyPlayers($row->how_many_players);
             $school->SetAgeRangeLower($row->age_range_lower);
             $school->SetAgeRangeUpper($row->age_range_upper);
             $school->SetPlaysOutdoors($row->plays_outdoors);
             $school->SetPlaysIndoors($row->plays_indoors);
             $school->SetShortUrl($row->short_url);
             $school->SetTwitterAccount($row->twitter);
             $school->SetFacebookUrl($row->facebook);
             $school->SetInstagramAccount($row->instagram);
             $school->SetClubmarkAccredited($row->clubmark);
             # Infer partial address from school name
             $school_name = $school->GetName();
             $comma = strrpos($school_name, ",");
             if ($comma !== false) {
                 $school->Ground()->GetAddress()->SetTown(trim(substr($school_name, $comma + 1)));
                 $school->Ground()->GetAddress()->SetPaon(substr($school_name, 0, $comma));
             }
         }
         # team the only cause of multiple rows (so far) so add to current school
         if ($row->team_id) {
             $team = new Team($this->GetSettings());
             $team->SetId($row->team_id);
             $team->SetName($row->team_name);
             $team->SetShortUrl($row->team_short_url);
             $school->Add($team);
         }
     }
     # store final club
     if ($school != null) {
         $this->Add($school);
     }
 }
開發者ID:stoolball-england,項目名稱:stoolball-england-website,代碼行數:55,代碼來源:school-manager.class.php


注:本文中的School::SetId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。