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


PHP Program::getId方法代碼示例

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


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

示例1: getAllProgramsFromDatabase

 public static function getAllProgramsFromDatabase($dbConn)
 {
     $programIds = readFromDatabase::readEntireColumnFromTable($dbConn, array(self::ID_COLUMN_NAME), self::TABLE_NAME);
     $programs = array();
     foreach ($programIds as $programId) {
         $program = new Program($dbConn, $programId[self::ID_COLUMN_NAME]);
         $programs[$program->getId()] = $program->getName();
     }
     return $programs;
 }
開發者ID:radioCKUT,項目名稱:digital-logsheets,代碼行數:10,代碼來源:manageProgramEntries.php

示例2: findByProgram

 /**
  * Search for all the Applications belonging to a program
  * @param Program $program
  * @param boolean $onlyPublished only find publisehd applications
  * @param boolean $onlyVisible only find visible applications
  * @param array   $excludedIds any application ids to exclude
  * @return Doctrine\Common\Collections\Collection $applications
  */
 public function findByProgram(Program $program, $onlyPublished = false, $onlyVisible = false, array $excludedIds = array())
 {
     $queryBuilder = $this->_em->createQueryBuilder();
     $queryBuilder->add('select', 'a')->from('Jazzee\\Entity\\Application', 'a');
     $queryBuilder->where('a.program = :programId');
     $queryBuilder->setParameter('programId', $program->getId());
     if ($onlyPublished) {
         $queryBuilder->andWhere('a.published = true');
     }
     if ($onlyVisible) {
         $queryBuilder->andWhere('a.visible = true');
     }
     if (!empty($excludedIds)) {
         //force integers from the values
         $safeids = array_map('intval', $excludedIds);
         $ids = implode(',', $safeids);
         $queryBuilder->andWhere("a.id NOT IN ({$ids})");
     }
     return $queryBuilder->getQuery()->getResult();
 }
開發者ID:Jazzee,項目名稱:Jazzee,代碼行數:28,代碼來源:ApplicationRepository.php

示例3: testProgramIdIsInteger

 /**
  * @requires extension opengl
  */
 public function testProgramIdIsInteger()
 {
     $program = new Program();
     $this->assertInternalType('int', $program->getId());
 }
開發者ID:ponup,項目名稱:ddd,代碼行數:8,代碼來源:ProgramTest.php


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