本文整理汇总了PHP中xPDOQuery类的典型用法代码示例。如果您正苦于以下问题:PHP xPDOQuery类的具体用法?PHP xPDOQuery怎么用?PHP xPDOQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了xPDOQuery类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
if ($active = $this->getProperty('active')) {
$c->where(array('active' => 1));
}
return $c;
}
开发者ID:bendasvadim,项目名称:miniPayment,代码行数:7,代码来源:getlist.class.php
示例2: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->select(array('qsbSetUserGroup.*', 'UserGroup.name'));
$c->innerJoin('modUserGroup', 'UserGroup');
$c->where(array('set' => $this->getProperty('id')));
return $c;
}
开发者ID:Realetive,项目名称:QuickstartButtons,代码行数:7,代码来源:getlist.class.php
示例3: prepareQueryBeforeCount
/**
* Can be used to adjust the query prior to the COUNT statement
*
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
if ($query = $this->getProperty('query', null)) {
$c->where(array('ip:LIKE' => '%' . $query . '%'));
}
return $c;
}
开发者ID:jolichter,项目名称:modxTalks,代码行数:14,代码来源:getlist.class.php
示例4: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->rightJoin('modResourceGroup', 'modResourceGroup', 'modResourceGroup.id = msdProductGroup.id');
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->select($this->modx->getSelectColumns('modResourceGroup', 'modResourceGroup'));
return $c;
}
开发者ID:Homchenkokostya,项目名称:msDiscount,代码行数:12,代码来源:getlist.class.php
示例5: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = $this->getProperty('searchbox');
$combo = $this->getProperty('combobox');
$history = $this->getProperty('historical');
//$qu = array();
if (!empty($query)) {
$qu = array('title:LIKE' => '%' . preg_replace('/[^a-rtzA-Z0-9]/', '%', $query) . '%');
}
$andState = !empty($query) ? 'AND:' : '';
if (!empty($combo)) {
$calfilt = $this->modx->newQuery('GcCalendarCalsConnect');
$calfilt->where(array('calid:=' => $combo));
$cals = $this->modx->getCollection('GcCalendarCalsConnect', $calfilt);
$cids = array();
foreach ($cals as $ca) {
$cids[] = $ca->get('evid');
}
$tp = array($andState . 'id:IN' => $cids);
}
$andState = !empty($query) || !empty($combo) ? 'AND:' : '';
$stime = strtotime('-1 day');
$tim = $history == 1 ? array($andState . 'start:<=' => $stime, 'AND:end:<=' => $stime, 'or:repeatenddate:<=' => $stime) : array($andState . 'start:>=' => $stime, 'OR:end:>=' => $stime, 'OR:repeatenddate:>=' => $stime);
$c->where(array($qu, $tp, $tim));
return $c;
}
开发者ID:blue148,项目名称:GCCalendar2,代码行数:26,代码来源:getlist.class.php
示例6: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
if ($tid = $this->getProperty('tid')) {
$c->where(array('tid' => $tid));
}
return parent::prepareQueryBeforeCount($c);
}
开发者ID:sfgoo,项目名称:xPoller2,代码行数:12,代码来源:getlist.class.php
示例7: getResults
protected function getResults(xPDOQuery &$c)
{
$list = array();
$this->currentIndex = 0;
if ($c->prepare()) {
if ($c->stmt->execute()) {
while ($row = $c->stmt->fetch(PDO::FETCH_ASSOC)) {
$object_id = $row['object_id'];
if (empty($list[$object_id])) {
$list[$object_id] = $row;
$list[$object_id]['tvs'] = array();
$this->currentIndex++;
}
if (!empty($row['tv_name'])) {
$list[$object_id]['tvs'][$row['tv_name']] = array('tv_id' => $row['tv_id'], 'caption' => $row['tv_caption'], 'category' => $row['tv_category'], 'value_id' => $row['tv_value_id'], 'value' => $row['tv_value']);
}
}
} else {
if ($c->stmt->errorCode() !== "00000") {
$this->modx->log(xPDO::LOG_LEVEL_ERROR, __CLASS__);
$this->modx->log(xPDO::LOG_LEVEL_ERROR, print_r($c->stmt->errorInfo(), true));
$this->modx->log(xPDO::LOG_LEVEL_ERROR, $c->toSQL());
}
}
}
return $list;
}
开发者ID:Tramp1357,项目名称:atlasorg,代码行数:27,代码来源:getdata.class.php
示例8: prepareQueryBeforeCount
function prepareQueryBeforeCount(xPDOQuery $c)
{
// Filter by position
if ($position = $this->getProperty('position')) {
$mode = $this->getProperty('mode', 'include');
$q = $this->modx->newQuery('byAdPosition');
$q->select('ad');
$q->where(array('position' => $position));
if ($q->prepare() && $q->stmt->execute()) {
$ads = array_unique($q->stmt->fetchAll(PDO::FETCH_COLUMN));
}
if (!empty($ads)) {
if ($mode == 'exclude') {
$c->where(array('id:NOT IN' => $ads));
} else {
$c->where(array('id:IN' => $ads));
}
}
}
// Filter by search query
if ($query = $this->getProperty('query')) {
$c->where(array('name:LIKE' => "%{$query}%", 'OR:description:LIKE' => "%{$query}%"));
}
return $c;
}
开发者ID:suasti,项目名称:BannerY,代码行数:25,代码来源:getlist.class.php
示例9: prepareQueryBeforeCount
/**
* {@inheritdoc}
* @param xPDOQuery $c
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$this->elementId = $this->getProperty('elementId', false);
$this->elementType = $this->getProperty('elementType', false);
$id = $this->getProperty('id', 0);
/*$tagNameParts = xPDO :: escSplit('@', $this->getProperty('tag'));
$propertySet = isset($tagNameParts[1]) ? trim($tagNameParts[1]) : null;
if (isset($propertySet) && strpos($propertySet,':') != false) {
$propSetParts = xPDO :: escSplit(':', $propertySet);
$propertySet = trim($propSetParts[0]);
}*/
$c->leftJoin('modElementPropertySet', 'Elements', array('Elements.element_class' => $this->elementType, 'Elements.element' => $this->elementId, 'Elements.property_set = modPropertySet.id'));
$this->showNotAssociated = (bool) $this->getProperty('showNotAssociated', false);
$showAssociated = (bool) $this->getProperty('showAssociated', false);
if ($this->showNotAssociated) {
$c->where(array('Elements.property_set' => null));
} else {
if ($showAssociated) {
$c->where(array('Elements.property_set:!=' => null));
}
}
/*if (empty($id)) {
$propertySet = $this->getProperty('propertySet', '');
if (!empty($propertySet) && $this->modx->getCount('modPropertySet', array('name'=>$propertySet))) {
$c->orCondition("modPropertySet.name = {$this->modx->quote($propertySet)}");
}
}*/
return $c;
}
开发者ID:sergant210,项目名称:tagElementPlugin,代码行数:34,代码来源:getpropertysetlist.class.php
示例10: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$lang_key = $this->getProperty('langid');
$contextlm = $this->getProperty('contextlm');
$c->where(array('lang_key' => $lang_key, 'context' => $contextlm));
return $c;
}
开发者ID:bendasvadim,项目名称:MODX.Xlexicon,代码行数:7,代码来源:getlist.class.php
示例11: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('sxNewsletter', 'sxNewsletter', 'sxNewsletter.id = sxQueue.newsletter_id');
$c->select($this->modx->getSelectColumns('sxQueue', 'sxQueue'));
$c->select('sxNewsletter.name as newsletter');
return $c;
}
开发者ID:ksneo,项目名称:Sendex,代码行数:12,代码来源:getlist.class.php
示例12: prepareQueryBeforeCount
/** {@inheritDoc} */
public function prepareQueryBeforeCount(xPDOQuery $c)
{
if ($query = $this->getProperty('query')) {
$c->where(array('word:LIKE' => "%{$query}%", 'OR:alias:LIKE' => "%{$query}%"));
}
return $c;
}
开发者ID:svyatoslavteterin,项目名称:belton.by,代码行数:8,代码来源:getlist.class.php
示例13: prepareQueryAfterCount
public function prepareQueryAfterCount(xPDOQuery $c)
{
if ($this->getProperty('sort') == 'category') {
$c->sortby('parent', $this->getProperty('dir', 'ASC'));
}
return $c;
}
开发者ID:raadhuis,项目名称:modx-basic,代码行数:7,代码来源:getlist.class.php
示例14: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$search = $this->getProperty('search', '');
if (!empty($search)) {
$c->where(array('name:LIKE' => '%' . $search . '%', 'OR:path:LIKE' => '%' . $search . '%'));
}
return $c;
}
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:8,代码来源:getlist.class.php
示例15: prepareQueryBeforeCount
/**
* @return mixed
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$tid = $this->getProperty('tid');
if ($tid) {
$c->where(array('template' => $tid));
}
return $c;
}
开发者ID:sergant210,项目名称:AdminTools,代码行数:11,代码来源:getlist.class.php
示例16: setSelection
protected function setSelection(xPDOQuery $c)
{
$c->select(array("Product.*", "Product.id as `product_id`", "{$this->classKey}.id as object_id"));
/*$c->prepare();
print $c->toSQL();
exit;*/
return $c;
}
开发者ID:bendasvadim,项目名称:NewsModxBox,代码行数:8,代码来源:getlist.class.php
示例17: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$form = (int) $this->getProperty('form');
if ($form) {
$c->where(array('form' => $form));
}
return $c;
}
开发者ID:bendasvadim,项目名称:VoteForms,代码行数:13,代码来源:getlist.class.php
示例18: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('id' => $query, 'OR:name:LIKE' => '%' . $query . '%'));
}
return $c;
}
开发者ID:Realetive,项目名称:QuickstartButtons,代码行数:8,代码来源:getlist.class.php
示例19: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = $this->getProperty('query');
if (!empty($query)) {
$c->where(array('local_name:LIKE' => '%' . $query . '%', 'OR:lang_code:LIKE' => '%' . $query . '%', 'OR:lcid_string:LIKE' => '%' . $query . '%', 'OR:lcid_dec:LIKE' => '%' . $query . '%'));
}
return $c;
}
开发者ID:DeFi-ManriquezLuis,项目名称:MTLTransfer,代码行数:8,代码来源:getlist.class.php
示例20: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$form = $this->getProperty('form_id');
if (!empty($form)) {
$c->where(array('form_id' => $form));
}
return $c;
}
开发者ID:doksec,项目名称:formz,代码行数:8,代码来源:getlist.class.php
注:本文中的xPDOQuery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论