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


PHP Match::SetTitle方法代码示例

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


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

示例1: BuildPostedDataObject

 /**
  * Builds a match object containing the result information posted by the control
  *
  */
 public function BuildPostedDataObject()
 {
     $tournament = new Match($this->GetSettings());
     $tournament->SetMatchType(MatchType::TOURNAMENT);
     # Get match id
     $s_key = $this->GetNamingPrefix() . 'item';
     if (isset($_POST[$s_key])) {
         $s_id = $_POST[$s_key];
         if (strlen($s_id)) {
             $tournament->SetId($s_id);
         }
     }
     # Get the title
     $s_key = $this->GetNamingPrefix() . 'Title';
     if (isset($_POST[$s_key])) {
         $tournament->SetTitle(strip_tags($_POST[$s_key]));
     }
     # Get the start date, because it's part of the title that has to be recreated for an internal postback
     $s_key = $this->GetNamingPrefix() . 'Start';
     if (isset($_POST[$s_key])) {
         $tournament->SetStartTime($_POST[$s_key]);
     }
     # Matches - get from aggregated editor
     $this->EnsureAggregatedEditors();
     $matches = $this->matches_editor->DataObjects()->GetItems();
     foreach ($matches as $match) {
         $tournament->AddMatchInTournament($match);
     }
     $this->SetDataObject($tournament);
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:34,代码来源:tournament-matches-control.class.php

示例2: BuildPostedItem

 /**
  * Re-build from data posted by this control a single data object which this control is editing
  *
  * @param int $i_counter
  * @param int $i_id
  */
 protected function BuildPostedItem($i_counter = null, $i_id = null)
 {
     $match = new Match($this->GetSettings());
     $match->SetMatchType(MatchType::TOURNAMENT_MATCH);
     $key = $this->GetNamingPrefix() . 'MatchId' . $i_counter;
     if (isset($_POST[$key]) and is_numeric($_POST[$key])) {
         $match->SetId($_POST[$key]);
     }
     $key = $this->GetNamingPrefix() . 'MatchOrder' . $i_counter;
     if (isset($_POST[$key]) and is_numeric($_POST[$key])) {
         $match->SetOrderInTournament($_POST[$key]);
     }
     $key = $this->GetNamingPrefix() . 'MatchIdValue' . $i_counter;
     if (isset($_POST[$key])) {
         $match->SetTitle($_POST[$key]);
     }
     $key = $this->GetNamingPrefix() . 'HomeTeamId' . $i_counter;
     if (isset($_POST[$key]) and $_POST[$key]) {
         $team = new Team($this->GetSettings());
         $team->SetId($_POST[$key]);
         $match->SetHomeTeam($team);
     }
     $key = $this->GetNamingPrefix() . 'AwayTeamId' . $i_counter;
     if (isset($_POST[$key]) and $_POST[$key]) {
         $team = new Team($this->GetSettings());
         $team->SetId($_POST[$key]);
         $match->SetAwayTeam($team);
     }
     if ($match->GetId() or $match->GetHomeTeamId() and $match->GetAwayTeamId()) {
         $this->DataObjects()->Add($match);
     } else {
         $this->IgnorePostedItem($i_counter);
     }
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:40,代码来源:matches-in-tournament-editor.class.php

示例3: BuildPostedDataObject

 /**
  * Builds a match object containing the result information posted by the control
  *
  */
 public function BuildPostedDataObject()
 {
     $match = new Match($this->GetSettings());
     $match->SetMatchType(MatchType::TOURNAMENT);
     # Get match id
     $s_key = $this->GetNamingPrefix() . 'item';
     if (isset($_POST[$s_key])) {
         $s_id = $_POST[$s_key];
         if (strlen($s_id)) {
             $match->SetId($s_id);
         }
     }
     # Get the title
     $s_key = $this->GetNamingPrefix() . 'Title';
     if (isset($_POST[$s_key])) {
         $match->SetTitle(strip_tags($_POST[$s_key]));
     }
     $s_key = $this->GetNamingPrefix() . 'Seasons';
     if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
         $possibly_posted = explode(';', $_POST[$s_key]);
         foreach ($possibly_posted as $season_id) {
             $s_key = $this->GetNamingPrefix() . 'Season' . $season_id;
             if (isset($_POST[$s_key]) and $_POST[$s_key] == $season_id) {
                 $season = new Season($this->GetSettings());
                 $season->SetId($_POST[$s_key]);
                 $match->Seasons()->Add($season);
             }
         }
     }
     $this->SetDataObject($match);
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:35,代码来源:tournament-seasons-control.class.php

示例4: BuildPostedDataObject

 /**
  * Builds a match object containing the result information posted by the control
  *
  */
 public function BuildPostedDataObject()
 {
     $match = new Match($this->GetSettings());
     $match->SetMatchType(MatchType::TOURNAMENT);
     # Get match id
     $s_key = $this->GetNamingPrefix() . 'item';
     if (isset($_POST[$s_key])) {
         $s_id = $_POST[$s_key];
         if (strlen($s_id)) {
             $match->SetId($s_id);
         }
     }
     # Get the title
     $s_key = $this->GetNamingPrefix() . 'Title';
     if (isset($_POST[$s_key])) {
         $match->SetTitle(strip_tags($_POST[$s_key]));
     }
     # Get the qualification type
     $s_key = $this->GetNamingPrefix() . 'Qualify';
     if (isset($_POST[$s_key])) {
         $match->SetQualificationType($_POST[$s_key]);
     }
     # Get the player type
     $s_key = $this->GetNamingPrefix() . 'PlayerType';
     if (isset($_POST[$s_key])) {
         $match->SetPlayerType($_POST[$s_key]);
     }
     $s_key = $this->GetNamingPrefix() . "Players";
     if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
         $match->SetMaximumPlayersPerTeam($_POST[$s_key]);
     }
     # Get the number of overs
     $s_key = $this->GetNamingPrefix() . "Overs";
     if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
         $match->SetOvers($_POST[$s_key]);
     }
     # Get the short URL
     $s_key = $this->GetNamingPrefix() . 'ShortUrl';
     if (isset($_POST[$s_key])) {
         $match->SetShortUrl($_POST[$s_key]);
     }
     # Get the start date
     $s_key = $this->GetNamingPrefix() . 'Start';
     $match->SetStartTime(DateControl::GetPostedTimestampUtc($s_key));
     $match->SetIsStartTimeKnown(DateControl::GetIsTimePosted($s_key));
     # Get the initial team
     $team = new Team($this->GetSettings());
     $s_key = $this->GetNamingPrefix() . 'ContextTeam';
     if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
         $team->SetId($_POST[$s_key]);
         $match->AddAwayTeam($team);
     }
     # Get the ground
     $s_key = $this->GetNamingPrefix() . 'Ground';
     if (isset($_POST[$s_key]) and strlen($_POST[$s_key])) {
         $o_ground = new Ground($this->GetSettings());
         $o_ground->SetId($_POST[$s_key]);
         $match->SetGround($o_ground);
     }
     # Get the notes
     $s_key = $this->GetNamingPrefix() . 'Notes';
     if (isset($_POST[$s_key])) {
         $match->SetNotes($_POST[$s_key]);
     }
     $this->SetDataObject($match);
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:70,代码来源:tournament-edit-control.class.php

示例5: BuildMatchSummary

 /**
  * Helper to build basic info about a match from raw data
  *
  * @param Match $match
  * @param DataRow $row
  */
 private function BuildMatchSummary(Match $match, $row)
 {
     $match->SetId($row->match_id);
     if (isset($row->start_time)) {
         $match->SetStartTime($row->start_time);
     }
     if (isset($row->start_time_known)) {
         $match->SetIsStartTimeKnown($row->start_time_known);
     }
     if (isset($row->match_type)) {
         $match->SetMatchType($row->match_type);
     }
     if (isset($row->player_type_id)) {
         $match->SetPlayerType($row->player_type_id);
     }
     if (isset($row->qualification)) {
         $match->SetQualificationType($row->qualification);
     }
     if (isset($row->players_per_team)) {
         $match->SetMaximumPlayersPerTeam($row->players_per_team);
     }
     if (isset($row->max_tournament_teams)) {
         $match->SetMaximumTeamsInTournament($row->max_tournament_teams);
     }
     if (isset($row->tournament_spaces)) {
         $match->SetSpacesLeftInTournament($row->tournament_spaces);
     }
     if (isset($row->overs_per_innings)) {
         $match->SetOvers($row->overs_per_innings);
     }
     if (isset($row->match_title)) {
         $match->SetTitle($row->match_title);
     }
     if (isset($row->custom_title)) {
         $match->SetUseCustomTitle($row->custom_title);
     }
     if (isset($row->home_bat_first) and !is_null($row->home_bat_first)) {
         $match->Result()->SetHomeBattedFirst($row->home_bat_first);
     }
     if (isset($row->won_toss) and !is_null($row->won_toss)) {
         $match->Result()->SetTossWonBy($row->won_toss);
     }
     if (isset($row->home_runs)) {
         $match->Result()->SetHomeRuns($row->home_runs);
     }
     if (isset($row->home_wickets)) {
         $match->Result()->SetHomeWickets($row->home_wickets);
     }
     if (isset($row->away_runs)) {
         $match->Result()->SetAwayRuns($row->away_runs);
     }
     if (isset($row->away_wickets)) {
         $match->Result()->SetAwayWickets($row->away_wickets);
     }
     if (isset($row->home_points)) {
         $match->Result()->SetHomePoints($row->home_points);
     }
     if (isset($row->away_points)) {
         $match->Result()->SetAwayPoints($row->away_points);
     }
     if (isset($row->player_of_match_id)) {
         $player = new Player($this->GetSettings());
         $player->SetId($row->player_of_match_id);
         $player->SetName($row->player_of_match);
         $player->SetShortUrl($row->player_of_match_url);
         $player->Team()->SetId($row->player_of_match_team_id);
         $match->Result()->SetPlayerOfTheMatch($player);
     }
     if (isset($row->player_of_match_home_id)) {
         $player = new Player($this->GetSettings());
         $player->SetId($row->player_of_match_home_id);
         $player->SetName($row->player_of_match_home);
         $player->SetShortUrl($row->player_of_match_home_url);
         $player->Team()->SetId($row->player_of_match_home_team_id);
         $match->Result()->SetPlayerOfTheMatchHome($player);
     }
     if (isset($row->player_of_match_away_id)) {
         $player = new Player($this->GetSettings());
         $player->SetId($row->player_of_match_away_id);
         $player->SetName($row->player_of_match_away);
         $player->SetShortUrl($row->player_of_match_away_url);
         $player->Team()->SetId($row->player_of_match_away_team_id);
         $match->Result()->SetPlayerOfTheMatchAway($player);
     }
     if (isset($row->match_notes)) {
         $match->SetNotes($row->match_notes);
     }
     if (isset($row->short_url)) {
         $match->SetShortUrl($row->short_url);
     }
     if (isset($row->update_search) and $row->update_search == 1) {
         $match->SetSearchUpdateRequired();
     }
     if (isset($row->added_by) and is_numeric($row->added_by)) {
//.........这里部分代码省略.........
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:101,代码来源:match-manager.class.php

示例6: BuildPostedScorecard

 /**
  * Builds data posted on pages 2/3 back into a match object
  * @return Match
  */
 private function BuildPostedScorecard()
 {
     $match = new Match($this->GetSettings());
     $match->SetId($this->GetDataObjectId());
     # Must have data on which team is which, otherwise none of the rest makes sense
     # Team ids are essential for saving data, while team names and match title are
     # purely so they can be redisplayed if the page is invalid
     $key = "teams";
     if (!isset($_POST[$key]) or strpos($_POST[$key], ScorecardEditControl::DATA_SEPARATOR) === false) {
         return $match;
     }
     $teams = explode(ScorecardEditControl::DATA_SEPARATOR, $_POST[$key], 6);
     if (count($teams) != 6) {
         return $match;
     }
     switch ($teams[0]) {
         case "0":
             $match->Result()->SetHomeBattedFirst(false);
             $home_batting = $this->GetCurrentPage() == 3;
             break;
         case "1":
             $match->Result()->SetHomeBattedFirst(true);
             $home_batting = $this->GetCurrentPage() == 2;
             break;
         default:
             $home_batting = $this->GetCurrentPage() == 2;
     }
     $home_team = new Team($this->GetSettings());
     $home_team->SetId($teams[1]);
     $home_team->SetName($teams[2]);
     $match->SetHomeTeam($home_team);
     $away_team = new Team($this->GetSettings());
     $away_team->SetId($teams[3]);
     $away_team->SetName($teams[4]);
     $match->SetAwayTeam($away_team);
     $match->SetTitle($teams[5]);
     # Read posted batting data
     $key = "batRows";
     if (isset($_POST[$key])) {
         # This controls not only which fields are read, but also which are redisplayed on an invalid postback or for the next innings.
         $match->SetMaximumPlayersPerTeam(intval($_POST[$key]));
     }
     for ($i = 1; $i <= $match->GetMaximumPlayersPerTeam(); $i++) {
         $key = "batName{$i}";
         if (isset($_POST[$key])) {
             # The row exists - has it been filled in?
             if (trim($_POST[$key])) {
                 # Read the batter data in this row
                 $player = new Player($this->GetSettings());
                 $player->SetName($_POST[$key]);
                 $player->Team()->SetId($home_batting ? $home_team->GetId() : $away_team->GetId());
                 $key = "batHowOut{$i}";
                 $how_out = (isset($_POST[$key]) and is_numeric($_POST[$key])) ? (int) $_POST[$key] : null;
                 $key = "batOutBy{$i}";
                 $dismissed_by = null;
                 if (isset($_POST[$key]) and trim($_POST[$key])) {
                     $dismissed_by = new Player($this->GetSettings());
                     $dismissed_by->SetName($_POST[$key]);
                     $dismissed_by->Team()->SetId($home_batting ? $away_team->GetId() : $home_team->GetId());
                 }
                 $key = "batBowledBy{$i}";
                 $bowler = null;
                 if (isset($_POST[$key]) and trim($_POST[$key])) {
                     $bowler = new Player($this->GetSettings());
                     $bowler->SetName($_POST[$key]);
                     $bowler->Team()->SetId($home_batting ? $away_team->GetId() : $home_team->GetId());
                 }
                 # Correct caught and bowled if marked as caught
                 if ($how_out == Batting::CAUGHT and !is_null($dismissed_by) and !is_null($bowler) and trim($dismissed_by->GetName()) == trim($bowler->GetName())) {
                     $how_out = Batting::CAUGHT_AND_BOWLED;
                     $dismissed_by = null;
                 }
                 $key = "batRuns{$i}";
                 $runs = (isset($_POST[$key]) and is_numeric($_POST[$key])) ? (int) $_POST[$key] : null;
                 $key = "batBalls{$i}";
                 $balls = (isset($_POST[$key]) and is_numeric($_POST[$key])) ? (int) $_POST[$key] : null;
                 # Add that batting performance to the match result
                 $batting = new Batting($player, $how_out, $dismissed_by, $bowler, $runs, $balls);
                 if ($home_batting) {
                     $match->Result()->HomeBatting()->Add($batting);
                 } else {
                     $match->Result()->AwayBatting()->Add($batting);
                 }
             }
         }
     }
     $key = "batByes";
     if (isset($_POST[$key]) and is_numeric($_POST[$key])) {
         $player = new Player($this->GetSettings());
         $player->SetPlayerRole(Player::BYES);
         $player->Team()->SetId($home_batting ? $home_team->GetId() : $away_team->GetId());
         $batting = new Batting($player, null, null, null, (int) $_POST[$key]);
         if ($home_batting) {
             $match->Result()->HomeBatting()->Add($batting);
         } else {
             $match->Result()->AwayBatting()->Add($batting);
//.........这里部分代码省略.........
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:101,代码来源:scorecard-edit-control.class.php


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