本文整理汇总了PHP中Club::SetId方法的典型用法代码示例。如果您正苦于以下问题:PHP Club::SetId方法的具体用法?PHP Club::SetId怎么用?PHP Club::SetId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Club
的用法示例。
在下文中一共展示了Club::SetId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnPostback
function OnPostback()
{
# get object
$this->o_club = $this->o_edit->GetDataObject();
# save data if valid
if ($this->IsValid()) {
$i_id = $this->o_club_manager->Save($this->o_club);
$this->o_club->SetId($i_id);
$this->Redirect($this->o_club->GetNavigateUrl());
}
}
示例2: OnPostback
function OnPostback()
{
$this->school = $this->edit->GetDataObject();
# save data if valid
if ($this->IsValid()) {
require_once "stoolball/clubs/club-manager.class.php";
$club_manager = new ClubManager($this->GetSettings(), $this->GetDataConnection());
$id = $club_manager->Save($this->school);
$this->school->SetId($id);
$this->Redirect($this->school->GetNavigateUrl() . "/edit");
}
}
示例3: BuildPostedDataObject
/**
* @return void
* @desc Re-build from data posted by this control the data object this control is editing
*/
public function BuildPostedDataObject()
{
$school = new Club($this->GetSettings());
if (isset($_POST['item'])) {
$school->SetId($_POST['item']);
}
$school->SetTypeOfClub(Club::SCHOOL);
$school->SetName($_POST['school-name'] . ", " . $_POST["town"]);
$this->SetDataObject($school);
}
示例4: 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
$club_builder = new CollectionBuilder();
$club = null;
while ($row = $result->fetch()) {
# check whether this is a new club
if (!$club_builder->IsDone($row->club_id)) {
# store any exisiting club
if ($club != null) {
$this->Add($club);
}
# create the new club
$club = new Club($this->GetSettings());
$club->SetId($row->club_id);
$club->SetName($row->club_name);
$club->SetTypeOfClub($row->club_type);
$club->SetHowManyPlayers($row->how_many_players);
$club->SetAgeRangeLower($row->age_range_lower);
$club->SetAgeRangeUpper($row->age_range_upper);
$club->SetPlaysOutdoors($row->plays_outdoors);
$club->SetPlaysIndoors($row->plays_indoors);
$club->SetShortUrl($row->short_url);
$club->SetTwitterAccount($row->twitter);
$club->SetFacebookUrl($row->facebook);
$club->SetInstagramAccount($row->instagram);
$club->SetClubmarkAccredited($row->clubmark);
}
# team the only cause of multiple rows (so far) so add to current club
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);
$club->Add($team);
}
}
# store final club
if ($club != null) {
$this->Add($club);
}
}
示例5: BuildPostedDataObject
/**
* @return void
* @desc Re-build from data posted by this control the data object this control
* is editing
*/
function BuildPostedDataObject()
{
$club = new Club($this->GetSettings());
if (isset($_POST['item'])) {
$club->SetId($_POST['item']);
}
$club->SetName($_POST['name']);
$club->SetTypeOfClub(isset($_POST['school']) ? Club::SCHOOL : Club::STOOLBALL_CLUB);
$club->SetHowManyPlayers($_POST['how_many_players']);
$club->SetAgeRangeLower($_POST['age_range_lower']);
$club->SetAgeRangeUpper($_POST['age_range_upper']);
$club->SetPlaysOutdoors(isset($_POST['outdoors']));
$club->SetPlaysIndoors(isset($_POST['indoors']));
$club->SetClubmarkAccredited(isset($_POST['clubmark']));
$club->SetTwitterAccount($_POST['twitter']);
$club->SetFacebookUrl($_POST['facebook']);
$club->SetInstagramAccount($_POST['instagram']);
$club->SetShortUrl($_POST[$this->GetNamingPrefix() . 'ShortUrl']);
$this->SetDataObject($club);
}
示例6: BuildPostedDataObject
/**
* @return void
* @desc Re-build from data posted by this control the data object this control is editing
*/
function BuildPostedDataObject()
{
$team = new Team($this->GetSettings());
if (isset($_POST['item'])) {
$team->SetId($_POST['item']);
}
if (isset($_POST['name'])) {
$team->SetName($_POST['name']);
}
$team->SetWebsiteUrl($_POST['websiteUrl']);
$team->SetIsActive(isset($_POST['playing']));
$team->SetIntro(ucfirst(trim($_POST['intro'])));
$team->SetPlayingTimes($_POST['times']);
$team->SetCost($_POST['yearCost']);
$team->SetContact($_POST['contact']);
$team->SetPrivateContact($_POST['private']);
$ground = new Ground($this->GetSettings());
$ground->SetId($_POST['ground']);
$team->SetGround($ground);
if (isset($_POST['team_type'])) {
$team->SetTeamType($_POST['team_type']);
if ($team->GetTeamType() == Team::SCHOOL_YEARS) {
$team->SetSchoolYears(array(1 => isset($_POST['year1']), 2 => isset($_POST['year2']), 3 => isset($_POST['year3']), 4 => isset($_POST['year4']), 5 => isset($_POST['year5']), 6 => isset($_POST['year6']), 7 => isset($_POST['year7']), 8 => isset($_POST['year8']), 9 => isset($_POST['year9']), 10 => isset($_POST['year10']), 11 => isset($_POST['year11']), 12 => isset($_POST['year12'])));
}
}
if ($this->is_admin) {
$team->SetShortUrl($_POST[$this->GetNamingPrefix() . 'ShortUrl']);
$team->SetPlayerType($_POST['playerType']);
if (isset($_POST['club']) and is_numeric($_POST['club'])) {
$club = new Club($this->GetSettings());
$club->SetId($_POST['club']);
$team->SetClub($club);
}
}
$this->SetDataObject($team);
}
示例7: BuildItems
/**
* Populates the collection of business objects from raw data
*
* @return bool
* @param MySqlRawData $o_result
*/
protected function BuildItems(MySqlRawData $o_result)
{
$this->Clear();
/* @var $o_team Team */
# use CollectionBuilder to handle duplicates
$o_team_builder = new CollectionBuilder();
$o_season_builder = new CollectionBuilder();
$o_team = null;
while ($row = $o_result->fetch()) {
# check whether this is a new team
if (!$o_team_builder->IsDone($row->team_id)) {
# store any exisiting team
if ($o_team != null) {
$this->Add($o_team);
$o_season_builder->Reset();
}
# create the new team
$o_team = new Team($this->o_settings);
$o_team->SetId($row->team_id);
$o_team->SetName($row->team_name);
if (isset($row->website)) {
$o_team->SetWebsiteUrl($row->website);
}
if (isset($row->active)) {
$o_team->SetIsActive($row->active);
}
if (isset($row->team_type)) {
$o_team->SetTeamType($row->team_type);
}
if (isset($row->intro)) {
$o_team->SetIntro($row->intro);
}
if (isset($row->playing_times)) {
$o_team->SetPlayingTimes($row->playing_times);
}
if (isset($row->cost)) {
$o_team->SetCost($row->cost);
}
if (isset($row->contact)) {
$o_team->SetContact($row->contact);
}
if (isset($row->contact_nsa)) {
$o_team->SetPrivateContact($row->contact_nsa);
}
if (isset($row->short_url)) {
$o_team->SetShortUrl($row->short_url);
}
if (isset($row->player_type_id)) {
$o_team->SetPlayerType($row->player_type_id);
}
$o_team->SetSchoolYears(array(1 => isset($row->year1) and $row->year1, 2 => isset($row->year2) and $row->year2, 3 => isset($row->year3) and $row->year3, 4 => isset($row->year4) and $row->year4, 5 => isset($row->year5) and $row->year5, 6 => isset($row->year6) and $row->year6, 7 => isset($row->year7) and $row->year7, 8 => isset($row->year8) and $row->year8, 9 => isset($row->year9) and $row->year9, 10 => isset($row->year10) and $row->year10, 11 => isset($row->year11) and $row->year11, 12 => isset($row->year12) and $row->year12));
if (isset($row->update_search) and $row->update_search == 1) {
$o_team->SetSearchUpdateRequired();
}
if (isset($row->date_changed)) {
$o_team->SetLastAudit(new AuditData($row->modified_by_id, $row->known_as, $row->date_changed));
}
$club = new Club($this->GetSettings());
if (isset($row->club_id)) {
$club->SetId($row->club_id);
if (isset($row->club_name)) {
$club->SetName($row->club_name);
}
if (isset($row->twitter)) {
$club->SetTwitterAccount($row->twitter);
}
if (isset($row->facebook)) {
$club->SetFacebookUrl($row->facebook);
}
if (isset($row->instagram)) {
$club->SetInstagramAccount($row->instagram);
}
if (isset($row->clubmark)) {
$club->SetClubmarkAccredited($row->clubmark);
}
if (isset($row->club_short_url)) {
$club->SetShortUrl($row->club_short_url);
}
}
# If the website is actually a Facebook page, move it, overriding the club Facebook page is necessary
if (strpos($o_team->GetWebsiteUrl(), 'facebook.com/') !== false) {
$club->SetFacebookUrl($o_team->GetWebsiteUrl());
$o_team->SetWebsiteUrl('');
}
$o_team->SetClub($club);
if (isset($row->ground_id) and $row->ground_id) {
$o_ground = new Ground($this->o_settings);
$o_ground->SetId($row->ground_id);
$address = $o_ground->GetAddress();
if (isset($row->saon)) {
$address->SetSaon($row->saon);
}
if (isset($row->town)) {
if (isset($row->paon)) {
//.........这里部分代码省略.........