本文整理汇总了PHP中Doctrine_Query::leftJoin方法的典型用法代码示例。如果您正苦于以下问题:PHP Doctrine_Query::leftJoin方法的具体用法?PHP Doctrine_Query::leftJoin怎么用?PHP Doctrine_Query::leftJoin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine_Query
的用法示例。
在下文中一共展示了Doctrine_Query::leftJoin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listPeriodeFiliereRegion
public function listPeriodeFiliereRegion(Doctrine_Query $q)
{
$rootAlias = $q->getRootAlias();
$q->leftJoin($rootAlias . '.CopisimFiliere c');
$q->leftJoin($rootAlias . '.CopisimRegion d');
return $q;
}
示例2: addProductTranslationJoin
public function addProductTranslationJoin(Doctrine_Query $q, $lang = false)
{
if (!$lang) {
return $q->leftJoin($q->getRootAlias() . '.Translation trans');
} else {
return $q->leftJoin($q->getRootAlias() . '.Translation trans WITH trans.lang = ?', $lang);
}
}
示例3: retrieveAdminChargeList
public function retrieveAdminChargeList(Doctrine_Query $q)
{
$rootAlias = $q->getRootAlias();
$q->leftJoin($rootAlias . '.Category ct');
$q->leftJoin($rootAlias . '.Vehicle v');
$q->andWhere('v.is_archived = ?', false);
return $q;
}
示例4: buildQuery
function buildQuery(Doctrine_Query $query)
{
$query->leftJoin('swBlogPost.Translation');
$query->leftJoin('swBlogPost.swBlogPostTags t');
$query->leftJoin('t.Translation tt');
if (strlen($this->getValue('tag')) > 0) {
$query->addWhere('tt.name = ? and tt.lang = ?', array($this->getValue('tag'), sfContext::getInstance()->getUser()->getCulture()));
}
if (!is_null($this->getValue('published'))) {
$query->addWhere('swBlogPost.published = ?', $this->getValue('published'));
}
$query->orderBy('created_at DESC');
return $query;
}
示例5: filterByEditable
public function filterByEditable(Doctrine_Query $q, $user_id = null)
{
if (is_null($user_id)) {
$user_id = sfContext::getInstance()->getUser()->getGuardUser()->getId();
if (sfContext::getInstance()->getUser()->hasCredential('admin')) {
return;
}
}
$rootAlias = $q->getRootAlias();
$q->leftJoin($rootAlias . '.Categories c');
$q->leftJoin('c.Users u');
$q->leftJoin($rootAlias . '.Editors e');
$q->addWhere('author_id = ? OR u.id = ? OR e.id = ?', array($user_id, $user_id, $user_id));
}
示例6: setDoctrineQuery
/**
* Set Doctrine Query.
*
* Set the Doctrine Query Object and expand configuration with it's information.
*
* @param Doctrine_Query $query Doctrine Query Object.
* @param array $filter Filter object to be processed to enrich the Query.
*
* @return void
*/
public function setDoctrineQuery(Doctrine_Query $query, $filter)
{
$this->resetColumns();
$this->_doctrineQuery = $query;
$tables = $this->_getTableInformation();
$aliasMap = $this->_doctrineQuery->getTableAliasMap();
$tables = $this->_enrichTablesWithAlias($tables, $aliasMap);
// FIXME assumes any dynamic relation with first table found on FROM
$from = $this->_doctrineQuery->getDQLPart('from');
$main = explode(' ', $from[0]);
$main = $main[1];
// adds the external relation aliases
// depending on the filter object to process
$joins = array();
$this->_getFilterRelations($joins, $filter);
// stores the tables => dynaalias
$t = array();
$a = 'dynajoin1';
foreach ($joins as $join) {
$alias = substr($join, 0, strpos($join, ':'));
$t[$alias] = $a;
// add the dynamic left join
$this->_doctrineQuery->leftJoin("{$main}.{$alias} {$a}");
$a++;
}
$this->_setColumnsFromDoctrineTables($tables, $t);
}
示例7: retrieveAsso
public function retrieveAsso(Doctrine_Query $q)
{
$alias = $q->getRootAlias();
$q->select("{$alias}.name, {$alias}.login, {$alias}.description, {$alias}.logo, {$alias}.salle, {$alias}.phone, {$alias}.facebook, p.id, p.asso_id, p.couleur");
$q->leftJoin("{$alias}.Pole p");
return $q->fetchOne();
}
示例8: retrieveFolderList
public function retrieveFolderList(Doctrine_Query $q)
{
$alias = $q->getRootAlias();
$q->leftJoin($alias . '.Assets a');
$q->orderBy($alias . '.lft');
return $q;
}
示例9: retrieveBackendUuserList
/**
* Query for uuser list
* @param Doctrine_Query $q
* @return Doctrine_Query
*/
public function retrieveBackendUuserList(Doctrine_Query $q)
{
$rootAlias = $q->getRootAlias();
$q->leftJoin($rootAlias . '.BalanceUser bu');
$q->andWhere($rootAlias . '.utype=?', 'uuser');
$q->andWhere($rootAlias . '.password IS NOT NULL');
return $q;
}
示例10: addCodeColumnQuery
public function addCodeColumnQuery(Doctrine_Query $query, $field, $values)
{
if ($values != "") {
$alias = $query->getRootAlias();
$conn_MGR = Doctrine_Manager::connection();
$query->leftJoin($alias . '.SpecimensCodes cod')->andWhere("cod.referenced_relation = ?", array('specimens'))->andWhere("cod.record_id = {$alias}.id")->andWhere("cod.full_code_indexed = fullToIndex(" . $conn_MGR->quote($values, 'string') . ") ");
}
return $query;
}
示例11: addKernbegripListColumnQuery
public function addKernbegripListColumnQuery(Doctrine_Query $query, $field, $values)
{
if (!is_array($values)) {
$values = array($values);
}
if (!count($values)) {
return;
}
$query->leftJoin('r.expertKernbegrip expertKernbegrip')->andWhereIn('expertKernbegrip.kernbegrip_id', $values);
}
示例12: addAccepterListColumnQuery
public function addAccepterListColumnQuery(Doctrine_Query $query, $field, $values)
{
if (!is_array($values)) {
$values = array($values);
}
if (!count($values)) {
return;
}
$query->leftJoin($query->getRootAlias() . '.Friend Friend')->andWhereIn('Friend.accepter_id', $values);
}
示例13: addTrackListColumnQuery
public function addTrackListColumnQuery(Doctrine_Query $query, $field, $values)
{
if (!is_array($values)) {
$values = array($values);
}
if (!count($values)) {
return;
}
$query->leftJoin($query->getRootAlias() . '.userPlaylist userPlaylist')->andWhereIn('userPlaylist.track_id', $values);
}
示例14: addVehiclesListColumnQuery
public function addVehiclesListColumnQuery(Doctrine_Query $query, $field, $values)
{
if (!is_array($values)) {
$values = array($values);
}
if (!count($values)) {
return;
}
$query->leftJoin($query->getRootAlias() . '.ReportVehicle ReportVehicle')->andWhereIn('ReportVehicle.vehicle_id', $values);
}
示例15: addProceduresListColumnQuery
public function addProceduresListColumnQuery(Doctrine_Query $query, $field, $values)
{
if (!is_array($values)) {
$values = array($values);
}
if (!count($values)) {
return;
}
$query->leftJoin('r.UserProcedure UserProcedure')->andWhereIn('UserProcedure.procedure_id', $values);
}