本文整理汇总了PHP中Users_Privileges_Model::setSharedOwner方法的典型用法代码示例。如果您正苦于以下问题:PHP Users_Privileges_Model::setSharedOwner方法的具体用法?PHP Users_Privileges_Model::setSharedOwner怎么用?PHP Users_Privileges_Model::setSharedOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Users_Privileges_Model
的用法示例。
在下文中一共展示了Users_Privileges_Model::setSharedOwner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleEvent
function handleEvent($eventName, $data)
{
if ($eventName == 'vtiger.entity.aftersave.final') {
$module = $data->getModuleName();
if ($module != "Users") {
Users_Privileges_Model::setSharedOwner($data->get('shownerid'), $data->getId());
}
}
}
示例2: saveRecord
/**
* Function to save a given record model of the current module
* @param Vtiger_Record_Model $recordModel
*/
public function saveRecord(Vtiger_Record_Model $recordModel)
{
$moduleName = $this->get('name');
$focus = CRMEntity::getInstance($moduleName);
$fields = $focus->column_fields;
foreach ($fields as $fieldName => $fieldValue) {
$fieldValue = $recordModel->get($fieldName);
if (is_array($fieldValue)) {
$focus->column_fields[$fieldName] = $fieldValue;
} else {
if ($fieldValue !== null) {
$focus->column_fields[$fieldName] = decode_html($fieldValue);
}
}
}
$focus->mode = $recordModel->get('mode');
$focus->id = $recordModel->getId();
$focus->save($moduleName);
$recordModel->setData($focus->column_fields)->setId($focus->id)->setEntity($focus);
if ($recordModel->has('shownerid')) {
Users_Privileges_Model::setSharedOwner($recordModel);
}
return $recordModel;
}