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


PHP Contacts::searchList方法代码示例

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


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

示例1: actionList

 public function actionList($id = null)
 {
     $list = X2List::load($id);
     if (!isset($list)) {
         Yii::app()->user->setFlash('error', Yii::t('app', 'The requested page does not exist.'));
         $this->redirect(array('lists'));
     }
     $model = new Contacts('search');
     Yii::app()->user->setState('vcr-list', $id);
     $dataProvider = $model->searchList($id);
     $list->count = $dataProvider->totalItemCount;
     $list->runWithoutBehavior('X2FlowTriggerBehavior', function () use($list) {
         $list->save();
     });
     X2Flow::trigger('RecordViewTrigger', array('model' => $list));
     $this->render('list', array('listModel' => $list, 'dataProvider' => $dataProvider, 'model' => $model));
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:17,代码来源:ContactsController.php

示例2: array

//convert session var to sql
$order = preg_replace('/\\.desc$/', ' DESC', $order);
// ensure that order attribute is valid
$orderAttr = preg_replace('/ DESC$/', '', $order);
if (!is_string($orderAttr) || !Contacts::model()->hasAttribute(trim($orderAttr))) {
    $order = '';
}
//look up all ids of the list we are currently viewing
//find position of model in the list
$moduleTitle = Modules::displayName();
// decide which data provider to use
if (is_numeric($listId)) {
    $list = X2Model::model('X2List')->findByPk($listId);
    if (isset($list)) {
        $listLink = CHtml::link($list->name, array('/contacts/contacts/list', 'id' => $listId));
        $vcrDataProvider = $searchModel->searchList($listId);
    } else {
        // default to All Contacts
        $listLink = CHtml::link(Yii::t('contacts', 'All {module}', array('{module}' => $moduleTitle)), array('/contact/contacts/index'));
        $vcrDataProvider = $searchModel->searchAll();
    }
} elseif ($listId == 'myContacts') {
    $listLink = CHtml::link(Yii::t('contacts', 'My {module}', array('{module}' => $moduleTitle)), array('/contacts/contacts/myContacts'));
    $vcrDataProvider = $searchModel->searchMyContacts();
} elseif ($listId == 'newContacts') {
    $listLink = CHtml::link(Yii::t('contacts', 'New {module}', array('{module}' => $moduleTitle)), array('/contacts/contacts/newContacts'));
    $vcrDataProvider = $searchModel->searchNewContacts();
} elseif ($tagFlag) {
    $listLink = CHtml::link(Yii::t('contacts', 'Tag Search'), array('/search/search', 'term' => $listId));
    $_GET['tagField'] = $listId;
    $vcrDataProvider = $searchModel->searchAll();
开发者ID:dsyman2,项目名称:X2CRM,代码行数:31,代码来源:_vcrControls.php

示例3: actionList

 /**
  * Gets a list of contacts.
  */
 public function actionList()
 {
     $listId = $_POST['id'];
     $list = X2List::model()->findByPk($listId);
     if (isset($list)) {
         //$list=X2List::load($listId);
     } else {
         $list = X2List::model()->findByAttributes(array('name' => $listId));
         if (isset($list)) {
             $listId = $list->id;
             //$list=X2List::load($listId);
         } else {
             $this->_sendResponse(404, 'No list found with id: ' . $_POST['id']);
         }
     }
     $model = new Contacts('search');
     $dataProvider = $model->searchList($listId, 10);
     $data = $dataProvider->getData();
     $this->_sendResponse(200, json_encode($data), true);
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:23,代码来源:ApiController.php

示例4: actionList

 public function actionList()
 {
     $id = isset($_GET['id']) ? $_GET['id'] : 'all';
     if (is_numeric($id)) {
         $list = CActiveRecord::model('X2List')->findByPk($id);
     }
     if (isset($list)) {
         $model = new Contacts('searchList');
         $dataProvider = $model->searchList($id);
         $list->count = $dataProvider->totalItemCount;
         $list->save();
         $this->render('list', array('listModel' => $list, 'dataProvider' => $dataProvider, 'model' => $model));
     } else {
         if ($id == 'my') {
             $this->redirect(array('/contacts/myContacts'));
         } elseif ($id == 'new') {
             $this->redirect(array('/contacts/newContacts'));
         } else {
             $this->redirect(array('/contacts/allContacts'));
         }
     }
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:22,代码来源:DefaultController.php


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