当前位置: 首页>>代码示例>>PHP>>正文


PHP QueryBuilder::execute方法代码示例

本文整理汇总了PHP中QueryBuilder::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP QueryBuilder::execute方法的具体用法?PHP QueryBuilder::execute怎么用?PHP QueryBuilder::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryBuilder的用法示例。


在下文中一共展示了QueryBuilder::execute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fetch

 /**
  * Fetch
  * 
  * @return DocumentCollection A collection of the documents returned by the query
  */
 public function fetch()
 {
     $pluckIds = function ($item) {
         return $item['id'];
     };
     $results = $this->queryBuilder->execute()->fetchAll();
     $ids = array_map($pluckIds, $results);
     return new DocumentCollection($ids, $this->librarian);
 }
开发者ID:taproot,项目名称:librarian,代码行数:14,代码来源:Query.php

示例2: getMostSubmitted

 /**
  * Get list of forms ordered by it's count
  *
  * @param QueryBuilder $query
  * @param integer $limit
  * @param integer $offset
  *
  * @return array
  * @throws \Doctrine\ORM\NoResultException
  * @throws \Doctrine\ORM\NonUniqueResultException
  */
 public function getMostSubmitted($query, $limit = 10, $offset = 0, $column = 'fs.id', $as = 'submissions')
 {
     $asSelect = $as ? ' as ' . $as : '';
     $query->select('f.name as title, f.id, count(distinct ' . $column . ')' . $asSelect)->groupBy('f.id, f.name')->orderBy($as, 'DESC')->setMaxResults($limit)->setFirstResult($offset);
     $results = $query->execute()->fetchAll();
     return $results;
 }
开发者ID:smotalima,项目名称:mautic,代码行数:18,代码来源:SubmissionRepository.php

示例3: getMostEmails

 /**
  * Get pie graph data for Sent, Read and Failed email count
  *
  * @param QueryBuilder $query
  *
  * @return array
  * @throws \Doctrine\ORM\NoResultException
  * @throws \Doctrine\ORM\NonUniqueResultException
  */
 public function getMostEmails($query, $limit = 10, $offset = 0)
 {
     $query->setMaxResults($limit)->setFirstResult($offset);
     $results = $query->execute()->fetchAll();
     return $results;
 }
开发者ID:Jandersolutions,项目名称:mautic,代码行数:15,代码来源:StatRepository.php

示例4: countValue

 /**
  * Count a value in a column
  *
  * @param QueryBuilder $query
  *
  * @return array
  * @throws \Doctrine\ORM\NoResultException
  * @throws \Doctrine\ORM\NonUniqueResultException
  */
 public function countValue($query, $column, $value)
 {
     $query->select('count(' . $column . ') as quantity')->from(MAUTIC_TABLE_PREFIX . 'leads', 'l')->leftJoin('l', MAUTIC_TABLE_PREFIX . 'lead_points_change_log', 'lp', 'lp.lead_id = l.id')->andwhere($query->expr()->eq($column, ':value'))->setParameter('value', $value);
     $result = $query->execute()->fetch();
     return $result['quantity'];
 }
开发者ID:HomeRefill,项目名称:mautic,代码行数:15,代码来源:PointsChangeLogRepository.php

示例5: getHttpStatuses

 /**
  * Get pie graph data for http statuses
  *
  * @param QueryBuilder $query
  *
  * @return array
  * @throws \Doctrine\ORM\NoResultException
  * @throws \Doctrine\ORM\NonUniqueResultException
  */
 public function getHttpStatuses($query)
 {
     $query->select('ad.code as status, count(ad.code) as count')->groupBy('ad.code')->orderBy('count', 'DESC');
     $results = $query->execute()->fetchAll();
     $colors = GraphHelper::$colors;
     $graphData = array();
     $i = 0;
     foreach ($results as $result) {
         if (!isset($colors[$i])) {
             $i = 0;
         }
         $color = $colors[$i];
         $graphData[] = array('label' => $result['status'], 'color' => $colors[$i]['color'], 'highlight' => $colors[$i]['highlight'], 'value' => (int) $result['count']);
         $i++;
     }
     return $graphData;
 }
开发者ID:HomeRefill,项目名称:mautic,代码行数:26,代码来源:DownloadRepository.php

示例6: getHttpStatuses

 /**
  * Get pie graph data for http statuses
  *
  * @param QueryBuilder $query
  *
  * @return array
  * @throws \Doctrine\ORM\NoResultException
  * @throws \Doctrine\ORM\NonUniqueResultException
  */
 public function getHttpStatuses($query)
 {
     $query->select('ad.code as status, count(ad.code) as count')->groupBy('ad.code')->orderBy('count', 'DESC');
     $results = $query->execute()->fetchAll();
     $chart = new PieChart();
     foreach ($results as $result) {
         $chart->setDataset($result['status'], $result['count']);
     }
     return $chart->render();
 }
开发者ID:Yame-,项目名称:mautic,代码行数:19,代码来源:DownloadRepository.php


注:本文中的QueryBuilder::execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。