本文整理汇总了PHP中Match::SetIsStartTimeKnown方法的典型用法代码示例。如果您正苦于以下问题:PHP Match::SetIsStartTimeKnown方法的具体用法?PHP Match::SetIsStartTimeKnown怎么用?PHP Match::SetIsStartTimeKnown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Match
的用法示例。
在下文中一共展示了Match::SetIsStartTimeKnown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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)) {
//.........这里部分代码省略.........
示例2: CreateFixtureControls
//.........这里部分代码省略.........
}
}
$players_per_team = new XhtmlElement("label", $per_side_box);
$players_per_team->AddAttribute("for", $this->GetNamingPrefix() . "Players");
$players_per_team->AddControl(" players per team");
$players_part = new FormPart("How many players?", $players_per_team);
$players_part->AddCssClass("playersPerTeam");
$match_box->AddControl($players_part);
# Overs
$overs_box = new XhtmlSelect($this->GetNamingPrefix() . "Overs", null, $this->IsValid());
$overs_box->SetBlankFirst(true);
for ($i = 2; $i <= 8; $i++) {
$overs_box->AddControl(new XhtmlOption($i));
}
if ($match->GetIsOversKnown()) {
$overs_box->SelectOption($match->GetOvers());
}
$overs_label = new XhtmlElement("label", "Overs per innings");
$overs_label->AddAttribute("for", $overs_box->GetXhtmlId());
$overs_part = new FormPart($overs_label, new XhtmlElement("div", $overs_box));
$overs_part->AddCssClass("overs");
$match_box->AddControl($overs_part);
# Start date and time
if (!$match->GetStartTime()) {
# if no date set, use specified default
if ($this->i_default_time) {
$match->SetStartTime($this->i_default_time);
} else {
# if no date set and no default, default to today at 10.30am BST
# NOTE that if this is a new tournament in an old season, this date won't be selected because the available
# dates will be limited below and won't include today. It'll be the same day in the relevant year though.
$i_now = gmdate('U');
$match->SetStartTime(gmmktime(9, 30, 00, (int) gmdate('n', $i_now), (int) gmdate('d', $i_now), (int) gmdate('Y', $i_now)));
$match->SetIsStartTimeKnown(true);
}
}
$o_date = new DateControl($this->GetNamingPrefix() . 'Start', $match->GetStartTime(), $match->GetIsStartTimeKnown(), $this->IsValidSubmit());
$o_date->SetShowTime(true);
$o_date->SetRequireTime(false);
$o_date->SetMinuteInterval(5);
# if only one season to choose from, limit available dates to the length of that season
if ($this->context_season instanceof Season) {
if ($this->context_season->GetStartYear() == $this->context_season->GetEndYear()) {
$i_mid_season = gmmktime(0, 0, 0, 6, 30, $this->context_season->GetStartYear());
} else {
$i_mid_season = gmmktime(0, 0, 0, 12, 31, $this->context_season->GetStartYear());
}
$season_dates = Season::SeasonDates($i_mid_season);
$season_start_month = gmdate('n', $season_dates[0]);
$season_end_month = gmdate('n', $season_dates[1]);
if ($season_start_month) {
$o_date->SetMonthStart($season_start_month);
}
if ($season_end_month) {
$o_date->SetMonthEnd($season_end_month);
}
$season_start_year = $this->context_season->GetStartYear();
$season_end_year = $this->context_season->GetEndYear();
if ($season_start_year) {
$o_date->SetYearStart($season_start_year);
}
if ($season_end_year) {
$o_date->SetYearEnd($season_end_year);
}
}
$o_date_part = new FormPart('When?', $o_date);
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:67,代码来源:tournament-edit-control.class.php
示例3: CreateControls
protected function CreateControls()
{
$o_match = $this->GetDataObject();
if (is_null($o_match)) {
$o_match = new Match($this->GetSettings());
}
/* @var $o_match Match */
/* @var $o_team Team */
$b_got_home = !is_null($o_match->GetHomeTeam());
$b_got_away = !is_null($o_match->GetAwayTeam());
$b_is_new_match = !(bool) $o_match->GetId();
$b_is_tournament_match = false;
if ($this->i_match_type == MatchType::TOURNAMENT_MATCH) {
$b_is_tournament_match = $this->tournament instanceof Match;
} else {
if ($o_match->GetMatchType() == MatchType::TOURNAMENT_MATCH and $o_match->GetTournament() instanceof Match) {
$this->SetTournament($o_match->GetTournament());
$this->SetMatchType($o_match->GetMatchType());
$b_is_tournament_match = true;
}
}
$o_match_outer_1 = new XhtmlElement('div');
$o_match_outer_1->SetCssClass('MatchFixtureEdit');
$o_match_outer_1->AddCssClass($this->GetCssClass());
$this->SetCssClass('');
$o_match_outer_1->SetXhtmlId($this->GetNamingPrefix());
$o_match_outer_2 = new XhtmlElement('div');
$o_match_box = new XhtmlElement('div');
$this->AddControl($o_match_outer_1);
$o_match_outer_1->AddControl($o_match_outer_2);
$o_match_outer_2->AddControl($o_match_box);
if ($this->GetShowHeading()) {
$s_heading = str_replace('{0}', MatchType::Text($this->i_match_type), $this->GetHeading());
# Add match type if required
$o_title_inner_1 = new XhtmlElement('span', htmlentities($s_heading, ENT_QUOTES, "UTF-8", false));
$o_title_inner_2 = new XhtmlElement('span', $o_title_inner_1);
$o_title_inner_3 = new XhtmlElement('span', $o_title_inner_2);
$o_match_box->AddControl(new XhtmlElement('h2', $o_title_inner_3, "medium large"));
}
# Offer choice of season if appropriate
$season_count = $this->seasons->GetCount();
if ($season_count == 1 and $this->i_match_type != MatchType::PRACTICE) {
$o_season_id = new TextBox($this->GetNamingPrefix() . 'Season', $this->seasons->GetFirst()->GetId());
$o_season_id->SetMode(TextBoxMode::Hidden());
$o_match_box->AddControl($o_season_id);
} elseif ($season_count > 1 and $this->i_match_type != MatchType::PRACTICE) {
$o_season_id = new XhtmlSelect($this->GetNamingPrefix() . 'Season', '', $this->IsValidSubmit());
foreach ($this->Seasons()->GetItems() as $season) {
$o_season_id->AddControl(new XhtmlOption($season->GetCompetitionName(), $season->GetId()));
}
$o_match_box->AddControl(new FormPart('Competition', $o_season_id));
}
# Start date and time
$match_time_known = (bool) $o_match->GetStartTime();
if (!$match_time_known) {
# if no date set, use specified default
if ($this->i_default_time) {
$o_match->SetStartTime($this->i_default_time);
if ($b_is_tournament_match) {
$o_match->SetIsStartTimeKnown(false);
}
} else {
# if no date set and no default, default to today at 6.30pm BST
$i_now = gmdate('U');
$o_match->SetStartTime(gmmktime(17, 30, 00, (int) gmdate('n', $i_now), (int) gmdate('d', $i_now), (int) gmdate('Y', $i_now)));
}
}
$o_date = new DateControl($this->GetNamingPrefix() . 'Start', $o_match->GetStartTime(), $o_match->GetIsStartTimeKnown(), $this->IsValidSubmit());
$o_date->SetShowTime(true);
$o_date->SetRequireTime(false);
$o_date->SetMinuteInterval(5);
# if no date set and only one season to choose from, limit available dates to the length of that season
if (!$match_time_known and $season_count == 1) {
if ($this->Seasons()->GetFirst()->GetStartYear() == $this->Seasons()->GetFirst()->GetEndYear()) {
$i_mid_season = gmmktime(0, 0, 0, 6, 30, $this->Seasons()->GetFirst()->GetStartYear());
} else {
$i_mid_season = gmmktime(0, 0, 0, 12, 31, $this->Seasons()->GetFirst()->GetStartYear());
}
$season_dates = Season::SeasonDates($i_mid_season);
$season_start_month = gmdate('n', $season_dates[0]);
$season_end_month = gmdate('n', $season_dates[1]);
if ($season_start_month) {
$o_date->SetMonthStart($season_start_month);
}
if ($season_end_month) {
$o_date->SetMonthEnd($season_end_month + 1);
}
// TODO: need a better way to handle this, allowing overlap. Shirley has indoor matches until early April.
$season_start_year = $this->Seasons()->GetFirst()->GetStartYear();
$season_end_year = $this->Seasons()->GetFirst()->GetEndYear();
if ($season_start_year) {
$o_date->SetYearStart($season_start_year);
}
if ($season_end_year) {
$o_date->SetYearEnd($season_end_year);
}
}
if ($b_is_tournament_match) {
$o_date->SetShowDate(false);
$o_date->SetShowTime(false);
//.........这里部分代码省略.........
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:101,代码来源:match-fixture-edit-control.class.php