本文整理匯總了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;
}
示例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();
}
示例3: testProgramIdIsInteger
/**
* @requires extension opengl
*/
public function testProgramIdIsInteger()
{
$program = new Program();
$this->assertInternalType('int', $program->getId());
}