本文整理汇总了PHP中Contacts::getContactLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP Contacts::getContactLinks方法的具体用法?PHP Contacts::getContactLinks怎么用?PHP Contacts::getContactLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contacts
的用法示例。
在下文中一共展示了Contacts::getContactLinks方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionView
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
$type = 'sales';
$model = $this->loadModel($id);
$model->associatedContacts = Contacts::getContactLinks($model->associatedContacts);
parent::view($model, $type);
}
示例2: actionView
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
$type = 'quotes';
$model = $this->loadModel($id);
$model->associatedContacts = Contacts::getContactLinks($model->associatedContacts);
// find associated products and their quantities
$quoteProducts = QuoteProduct::model()->findAllByAttributes(array('quoteId' => $model->id));
$orders = array();
// array of product-quantity pairs
$total = 0;
// total price for the quote
foreach ($quoteProducts as $qp) {
$price = $qp->price * $qp->quantity;
if ($qp->adjustmentType == 'percent') {
$price += $price * ($qp->adjustment / 100);
$qp->adjustment = "{$qp->adjustment}%";
} else {
$price += $qp->adjustment;
}
$orders[] = array('name' => $qp->name, 'id' => $qp->productId, 'unit' => $qp->price, 'quantity' => $qp->quantity, 'adjustment' => $qp->adjustment, 'price' => $price);
$order = end($orders);
$total += $order['price'];
}
$dataProvider = new CArrayDataProvider($orders, array('keyField' => 'name', 'sort' => array('attributes' => array('name', 'unit', 'quantity', 'adjustment', 'price')), 'pagination' => array('pageSize' => false)));
parent::view($model, $type, array('dataProvider' => $dataProvider, 'total' => $total));
}
示例3: actionView
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
$model = $this->loadModel($id);
$model->assignedTo = User::getUserLinks($model->assignedTo);
$model->associatedContacts = Contacts::getContactLinks($model->associatedContacts);
$type = 'case';
parent::view($model, $type);
}
示例4: actionView
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
$type = 'opportunities';
$model = $this->loadModel($id);
$model->associatedContacts = Contacts::getContactLinks($model->associatedContacts);
if ($this->checkPermissions($model, 'view')) {
// add opportunity to user's recent item list
User::addRecentItem('o', $id, Yii::app()->user->getId());
parent::view($model, $type);
} else {
$this->redirect('index');
}
}
示例5: search
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria();
$fields = Fields::model()->findAllByAttributes(array('modelName' => 'Accounts'));
foreach ($fields as $field) {
$fieldName = $field->fieldName;
switch ($field->type) {
case 'boolean':
$criteria->compare($field->fieldName, $this->compareBoolean($this->{$fieldName}), true);
break;
case 'link':
$criteria->compare($field->fieldName, $this->compareLookup($field, $this->{$fieldName}), true);
break;
case 'assignment':
$criteria->compare($field->fieldName, $this->compareAssignment($this->{$fieldName}), true);
break;
default:
$criteria->compare($field->fieldName, $this->{$fieldName}, true);
}
}
$dataProvider = new SmartDataProvider(get_class($this), array('sort' => array('defaultOrder' => 'name ASC'), 'pagination' => array('pageSize' => ProfileChild::getResultsPerPage()), 'criteria' => $criteria));
$arr = $dataProvider->getData();
foreach ($arr as $account) {
$account->assignedTo = User::getUserLinks($account->assignedTo);
$account->associatedContacts = Contacts::getContactLinks($account->associatedContacts);
}
$dataProvider->setData($arr);
return $dataProvider;
}