本文整理匯總了PHP中Doctrine_Query::innerJoin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Query::innerJoin方法的具體用法?PHP Doctrine_Query::innerJoin怎麽用?PHP Doctrine_Query::innerJoin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine_Query
的用法示例。
在下文中一共展示了Doctrine_Query::innerJoin方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testBug
public function testBug()
{
$person = $this->newPerson('Fixe');
$profile = $this->newProfile('Work', $person);
$guardUser = $person->get('sfGuardUser');
$id = $guardUser->get('id');
$guardUser->free();
$query = new Doctrine_Query();
$query->select('s.*, p.*, ps.*');
$query->from('sfGuardUser s');
$query->innerJoin('s.Person p');
$query->leftJoin('p.Profiles ps');
$query->where('s.id = ?', $id);
$user = $query->fetchOne();
$array = $user->toArray(true);
$this->assertEqual($array['id'], 1);
$this->assertEqual($array['name'], 'Fixe');
$this->assertTrue(isset($array['Person']['Profiles'][0]));
}
示例2: limitToHosts
public function limitToHosts(Doctrine_Query $q, array $hosts = array())
{
if (empty($hosts)) {
return $q;
}
$byName = array();
$byId = array();
foreach ($hosts as $host) {
if (is_string($host)) {
$byName[] = $host;
} else {
if (is_int($host)) {
$byId[] = $host;
} else {
if ($host instanceof IcingaHosts) {
$byId[] = $host->host_id;
}
}
}
}
$q->innerJoin('s.host h')->whereIn("h.display_name", $byName)->orWhereIn("h.host_id", $byId);
}
示例3: commonActivityConstraints
static function commonActivityConstraints(Doctrine_Query $q, $culture = 'et')
{
if ($q->hasAliasDeclaration('p') || $q->getRootAlias() == 'p') {
$q->innerJoin('p.Translation constraintTranslation WITH constraintTranslation.lang = ? AND constraintTranslation.name != ""', $culture);
}
return $q;
}
示例4: addCategoriesListColumnQuery
public function addCategoriesListColumnQuery(Doctrine_Query $query, $field, $value)
{
if (!strlen($value)) {
return;
}
if ($value === '-') {
$query->leftJoin($query->getRootAlias() . '.Categories c')->andWhere('c.id IS NULL');
} else {
$query->innerJoin($query->getRootAlias() . '.Categories c WITH c.id = ?', $value);
}
}
示例5: retrieveWithQuestionsForList
public function retrieveWithQuestionsForList(Doctrine_Query $q)
{
$rootAlias = $q->getRootAlias();
$q->innerJoin($rootAlias . '.Question q');
return $q;
}
示例6: addRelativesColumnQuery
protected function addRelativesColumnQuery(Doctrine_Query $query, $field, $values)
{
if ($values[0]) {
$query->innerJoin('r.NewsGroup ng ')->innerJoin('ng.StructureNewsGroup sng WITH sng.structure_id = ?', $values[0]);
}
}
示例7: retrieveAssetList
/**
* Retrieves a list of assets.
* table_method in list configuration of lyMediaAsset module
*
* @param Doctrine_Query $q
*/
public function retrieveAssetList(Doctrine_Query $q)
{
$q->innerJoin($q->getRootAlias() . '.Folder f');
return $q;
}
示例8: addRelativesColumnQuery
protected function addRelativesColumnQuery(Doctrine_Query $query, $field, $values)
{
if ($values) {
$query->innerJoin('r.BannerGroup bg')->innerJoin('bg.StructureBannerGroups sbg WITH sbg.structure_id = ? ', $values);
}
}
示例9: addProductGroupColumnQuery
protected function addProductGroupColumnQuery(Doctrine_Query $query, $field, $values)
{
if ($values) {
$query->innerJoin('r.ProductGroups pgs')->andWhereIn('pgs.group_id', $values);
}
}
示例10: addExtensionRequirement
static function addExtensionRequirement(Doctrine_Query $q, $extensions, $entityAlias = 'e', $aliasSuffix = '')
{
return $q->innerJoin($entityAlias . '.ExtensionRecord eerr' . $aliasSuffix)->innerJoin('eerr' . $aliasSuffix . '.Definition dd' . $aliasSuffix)->andWhereIn('dd' . $aliasSuffix . '.name', (array) $extensions);
}