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


PHP Team::setName方法代碼示例

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


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

示例1: createByName

 public function createByName($name)
 {
     print_r('[' . $name . ']');
     $document = new Team();
     $document->setName($name);
     $document->setSlug();
     $document->save();
     $document = $this->findOneBySlug($document->getSlug());
     return $document;
 }
開發者ID:bigjoevtrj,項目名稱:codeigniter-bootstrap,代碼行數:10,代碼來源:levelrepository.php

示例2: getOrCreateTeam

 protected function getOrCreateTeam($name, $nickname)
 {
     $nickname = trim($nickname);
     $name = trim(str_replace($nickname, '', $name));
     $slug = $this->CI->slugify->simple($name);
     $team = $this->CI->_team->findOneBySlug($slug);
     if (!$team) {
         $team = new Team();
         $team->setName($name);
         $team->setNickname($nickname);
         $team->save();
     }
     return $team;
 }
開發者ID:bigjoevtrj,項目名稱:codeigniter-bootstrap,代碼行數:14,代碼來源:PointstreakParse.php

示例3: 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

示例4: import

 /**
  * Import gitolite.conf
  *
  */
 public function import()
 {
     $file = file($this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR . self::GITOLITE_CONF_DIR . DIRECTORY_SEPARATOR . self::GITOLITE_CONF_FILE);
     foreach ($file as $line) {
         $line = trim($line);
         if ($line == '') {
             continue;
         }
         if (preg_match('/^[@]/', $line)) {
             $line_split = preg_split("/[=]+/", $line, 2);
             if (count($line_split) != 2) {
                 throw new \Exception('Invalid team def.');
             }
             $team_name = substr(trim($line_split[0]), 1);
             $team = new Team();
             $team->setName($team_name);
             $usr = preg_split("/[\\s\t]+/", trim($line_split[1]));
             foreach ($usr as $u) {
                 // is team
                 if (substr($u, 0, 1) == '@') {
                     $u = substr($u, 1);
                     if (!isset($this->teams[$u])) {
                         throw new \Exception('Undef team.');
                     }
                     $team->addTeam($this->teams[$u]);
                 } else {
                     if (isset($this->users[$u])) {
                         $team->addUser($this->users[$u]);
                     } else {
                         $user = new User();
                         $user->setUsername($u);
                         $key = $this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR . self::GITOLITE_KEY_DIR . DIRECTORY_SEPARATOR . $user->renderKeyFileName();
                         if (file_exists($key)) {
                             $user->addKey(file_get_contents($key));
                         }
                         $this->users[$u] = $user;
                         $team->addUser($user);
                     }
                 }
             }
             $this->teams[$team_name] = $team;
         } elseif (preg_match('/^repo/', $line)) {
             $line_split = preg_split("/[\\s\t]+/", $line, 2);
             if (count($line_split) != 2) {
                 throw new \Exception('Invalid repository def.');
             }
             $repo = new Repo();
             $repo->setName(trim($line_split[1]));
         } elseif (preg_match('/^(R|RW|RW\\+|\\-|RWC|RW\\+C|RWD|RW\\+D|RWCD|RW\\+CD|RWDC|RW\\+DC)/', $line)) {
             $teams = array();
             $users = array();
             $line_split = preg_split("/[=]+/", $line, 2);
             if (count($line_split) != 2) {
                 throw new \FuelException('Invalid rule.');
             }
             $acl_split = preg_split("/[\\s\t]+/", trim($line_split[0]), 2);
             $refexes = isset($acl_split[1]) ? $acl_split[1] : false;
             $acl = new Acl();
             $acl->setPermission($acl_split[0]);
             if ($refexes) {
                 $acl->setRefexes($refexes);
             }
             $usr = preg_split("/[\\s\t]+/", trim($line_split[1]));
             foreach ($usr as $u) {
                 // is team
                 if (substr($u, 0, 1) == '@') {
                     $u = substr($u, 1);
                     if (!isset($this->teams[$u])) {
                         throw new \Exception('Undef. team');
                     }
                     $acl->addTeam($this->teams[$u]);
                 } else {
                     if (!isset($this->users[$u])) {
                         $this->users[$u] = new User();
                         $this->users[$u]->setUsername($u);
                         $key = $this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR . self::GITOLITE_KEY_DIR . DIRECTORY_SEPARATOR . $this->users[$u]->renderKeyFileName();
                         if (file_exists($key)) {
                             $this->users[$u]->addKey(file_get_contents($key));
                         }
                     }
                     $acl->addUser($this->users[$u]);
                 }
             }
             $repo->addAcl($acl);
             $this->repos[$repo->getName()] = $repo;
         }
     }
 }
開發者ID:rafaelgou,項目名稱:gitolite-php,代碼行數:92,代碼來源:Gitolite.php

示例5: Team

<?php 
require_once "Team.class.php";
$hjk = new Team("HJK", "http://www.hjk.fi/", "1907");
$haka = new Team("FC Haka", "http://www.fchaka.fi/", "1934");
$tre = new Team("Tampere United ry", "http://www.tampereunited.com/", "1998");
echo $hjk;
// Käytettään __toString-metodia
echo $haka;
echo $tre;
// Olio välitetään aina viittauksena
$tre_viitattu = $tre;
// Viittaus.
// Paitsi jos todella haluat luoda kloonaamalla uuden.
$tre_kloonattu = clone $tre;
$tre->setName("Tampereen yhdistyneet ry");
// Vaihtaa myös tre-viitattu-olion nimen
// Seuraava kommentoitu sijoitus ei ole sallittu:
// $tre->_name = "Tampereen yhdistyneet ry";
// ,koska protected-attribuuttia voi muuttaa vain luokan sisällä
// tai siitä perityissä aliluokissa:
echo "<big style='background-color: yellow;'>Viitattu:</big>";
echo $tre_viitattu;
// Tulostaa: Tampereen yhdistyneet ry
echo "<big style='background-color: yellow;'>Kloonattu:</big>";
echo $tre_kloonattu;
// Tulostaa: Tampere United ry
?>
</body>
</html>
開發者ID:KoJootti,項目名稱:CircleCiTest,代碼行數:29,代碼來源:index.php


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