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


PHP Team::getId方法代码示例

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


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

示例1: with

 /**
  * Only include matches where a specific team played
  *
  * @param  Team   $team   Team        The team which played the matches
  * @param  string $result string|null The outcome of the matches (win, draw or loss)
  * @return self
  */
 public function with($team, $result = null)
 {
     if (!$team || !$team->isValid()) {
         return $this;
     }
     switch ($result) {
         case "wins":
         case "win":
         case "victory":
         case "victories":
             $query = "(team_a = ? AND team_a_points > team_b_points) OR (team_b = ? AND team_b_points > team_a_points)";
             break;
         case "loss":
         case "lose":
         case "losses":
         case "defeat":
         case "defeats":
             $query = "(team_a = ? AND team_b_points > team_a_points) OR (team_b = ? AND team_a_points > team_b_points)";
             break;
         case "draw":
         case "draws":
         case "tie":
         case "ties":
             $query = "(team_a = ? OR team_b = ?) AND team_a_points = team_b_points";
             break;
         default:
             $query = "team_a = ? OR team_b = ?";
     }
     $this->conditions[] = $query;
     $this->parameters[] = $team->getId();
     $this->parameters[] = $team->getId();
     $this->types .= 'ii';
     return $this;
 }
开发者ID:kleitz,项目名称:bzion,代码行数:41,代码来源:MatchQueryBuilder.php

示例2: with

 /**
  * Only include matches where a specific team/player played
  *
  * @param  Team|Player $participant The team/player which played the matches
  * @param  string      $result      The outcome of the matches (win, draw or loss)
  * @return self
  */
 public function with($participant, $result = null)
 {
     if (!$participant || !$participant->isValid()) {
         return $this;
     }
     if ($participant instanceof Team) {
         $team_a_query = "team_a = ?";
         $team_b_query = "team_b = ?";
     } elseif ($participant instanceof Player) {
         $team_a_query = "FIND_IN_SET(?, team_a_players)";
         $team_b_query = "FIND_IN_SET(?, team_b_players)";
     } else {
         throw new InvalidArgumentException("Invalid model provided");
     }
     switch ($result) {
         case "wins":
         case "win":
         case "victory":
         case "victories":
             $query = "({$team_a_query} AND team_a_points > team_b_points) OR ({$team_b_query} AND team_b_points > team_a_points)";
             break;
         case "loss":
         case "lose":
         case "losses":
         case "defeat":
         case "defeats":
             $query = "({$team_a_query} AND team_b_points > team_a_points) OR ({$team_b_query} AND team_a_points > team_b_points)";
             break;
         case "draw":
         case "draws":
         case "tie":
         case "ties":
             $query = "({$team_a_query} OR {$team_b_query}) AND team_a_points = team_b_points";
             break;
         default:
             $query = "{$team_a_query} OR {$team_b_query}";
     }
     $this->conditions[] = $query;
     $this->parameters[] = $participant->getId();
     $this->parameters[] = $participant->getId();
     return $this;
 }
开发者ID:allejo,项目名称:bzion,代码行数:49,代码来源:MatchQueryBuilder.php

示例3: load

 public function load()
 {
     $this->clear();
     // Miami Hurricanes
     $team = new Team('Miami, FL');
     $team->setOfficialName('University of Miami');
     $team->setNickname('Hurricanes');
     $team->setCity('Miami');
     $team->setState('FL');
     $team->setNcaaId(415);
     $level = $this->CI->_level->findOneBySlug('college');
     $team->setLevel($level);
     $league = $this->CI->_league->findOneBySlug('ncaa');
     $team->setLeague($league);
     $division = $this->CI->_division->findOneBySlug('d1');
     $team->setDivision($division);
     $conference = $this->CI->_conference->findOneBySlug('atlantic-coast');
     $team->setConference($conference);
     $team->save();
     print_r(sprintf("Created Team: %s (%s)\n", $team->getName(), $team->getId()));
     // Maryland Terrapins
     $team = new Team('Maryland');
     $team->setOfficialName('University of Maryland');
     $team->setNickname('Terrapins');
     $team->setCity('College Park');
     $team->setState('FL');
     $team->setNcaaId(392);
     $level = $this->CI->_level->findOneBySlug('college');
     $team->setLevel($level);
     $league = $this->CI->_league->findOneBySlug('ncaa');
     $team->setLeague($league);
     $division = $this->CI->_division->findOneBySlug('d1');
     $team->setDivision($division);
     $conference = $this->CI->_conference->findOneBySlug('atlantic-coast');
     $team->setConference($conference);
     $team->save();
     print_r(sprintf("Created Team: %s (%s)\n", $team->getName(), $team->getId()));
 }
开发者ID:bigjoevtrj,项目名称:codeigniter-bootstrap,代码行数:38,代码来源:team.php

示例4: removeMember

 /**
  * Remove a member from the discussion
  *
  * @todo
  *
  * @param  Player|Team $member The member to remove
  * @return void
  */
 public function removeMember($member)
 {
     if ($member instanceof Player) {
         $this->db->query("DELETE FROM `player_groups` WHERE `group` = ? AND `player` = ?", "ii", array($this->getId(), $member->getId()));
     } else {
         throw new Exception("Not implemented yet");
     }
 }
开发者ID:kleitz,项目名称:bzion,代码行数:16,代码来源:Group.php

示例5: getTeams

 public static function getTeams()
 {
     $dados = Database::ReadAll("team t", "t.*");
     if (!$dados) {
         return '';
     }
     foreach ($dados as $dado) {
         $team = new Team();
         $team->setId($dado['ID_TEAM']);
         $team->setName($dado['NAME_TEAM']);
         $team->setStatus($dado['STATUS']);
         $calebe = Calebe::getCalebe("AND c.id_person = " . $dado['ID_LEADER']);
         $team->setLeader($calebe);
         $team->setMembers(Team::getMembersTeam($team->getId()));
         $teams[] = $team;
     }
     return $teams;
 }
开发者ID:CarolinePaixao,项目名称:SCI,代码行数:18,代码来源:Team.php

示例6: getTeamEloOld

 /**
  * Get the team's old ELO
  * @param  Team $team The team whose old ELO to return
  * @return int|null   The old ELO, or null if the team provided has not
  *                    participated in the match
  */
 public function getTeamEloOld(Team $team)
 {
     if ($team->getId() == $this->team_a) {
         return $this->getTeamAEloOld();
     } elseif ($team->getId() == $this->team_b) {
         return $this->getTeamBEloOld();
     }
     return null;
 }
开发者ID:allejo,项目名称:bzion,代码行数:15,代码来源:Match.php

示例7: findAvailable

 public function findAvailable(Team $team)
 {
     $q = $this->createQuery('u')->where('NOT EXISTS (SELECT * FROM UserPerTeam upt WHERE upt.team_id = ? and upt.user_id = u.id)', $team->getId());
     return $q->execute();
 }
开发者ID:nubee,项目名称:nubee,代码行数:5,代码来源:sfGuardUserTable.class.php

示例8: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param Team $obj A Team object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         TeamPeer::$instances[$key] = $obj;
     }
 }
开发者ID:takisp,项目名称:bookingCourt,代码行数:22,代码来源:BaseTeamPeer.php

示例9: prune

 /**
  * Exclude object from result
  *
  * @param   Team $team Object to remove from the list of results
  *
  * @return TeamQuery The current query, for fluid interface
  */
 public function prune($team = null)
 {
     if ($team) {
         $this->addUsingAlias(TeamPeer::ID, $team->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
开发者ID:takisp,项目名称:bookingCourt,代码行数:14,代码来源:BaseTeamQuery.php

示例10: ensureConsistency

 /**
  * Checks and repairs the internal consistency of the object.
  *
  * This method is executed after an already-instantiated object is re-hydrated
  * from the database.  It exists to check any foreign keys to make sure that
  * the objects related to the current object are correct based on foreign key.
  *
  * You can override this method in the stub class, but you should always invoke
  * the base method from the overridden method (i.e. parent::ensureConsistency()),
  * in case your model changes.
  *
  * @throws PropelException
  */
 public function ensureConsistency()
 {
     if ($this->aDealer !== null && $this->dealer_id !== $this->aDealer->getId()) {
         $this->aDealer = null;
     }
     if ($this->aTeam !== null && $this->team_id !== $this->aTeam->getId()) {
         $this->aTeam = null;
     }
 }
开发者ID:thelia-modules,项目名称:DealerTeam,代码行数:22,代码来源:DealerTeam.php

示例11: serialize

 /**
  * {@inheritdoc}
  */
 public function serialize()
 {
     return serialize(array('team' => $this->team->getId(), 'deleter' => $this->deleter->getId()));
 }
开发者ID:blast007,项目名称:bzion,代码行数:7,代码来源:TeamDeleteEvent.php

示例12: testMiscMethods

 public function testMiscMethods()
 {
     $this->team = Team::createTeam("Sample Team", $this->player->getId(), "Avatar", "Description");
     $team = Team::get($this->team->getId());
     $this->assertEquals("now", $team->getCreationDate());
 }
开发者ID:bchhun,项目名称:bzion,代码行数:6,代码来源:TeamTest.php

示例13: getTooltipProjectCandidates

 private function getTooltipProjectCandidates(Team $team)
 {
     $projects = $team->getProjects();
     $teamid = $team->getId();
     $candidatesList = array();
     foreach ($projects as $id => $name) {
         $project = ProjectCache::getInstance()->getProject($id);
         // do not display SideTasksProjects & ExternalTaskProject
         if ($project->isExternalTasksProject() || $project->isSideTasksProject(array($teamid))) {
             continue;
         }
         $candidatesList[$id] = $name;
     }
     return $candidatesList;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:15,代码来源:edit_team.php

示例14: removeTeam

 public function removeTeam(Team $team)
 {
     $this->unlink('Teams', array($team->getId()));
     $this->save();
 }
开发者ID:nubee,项目名称:nubee,代码行数:5,代码来源:sfGuardUser.class.php

示例15: lookup

 function lookup($id)
 {
     return $id && is_numeric($id) && ($team = new Team($id)) && $team->getId() == $id ? $team : null;
 }
开发者ID:KingsleyGU,项目名称:osticket,代码行数:4,代码来源:class.team.php


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