本文整理汇总了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);
}