本文整理汇总了PHP中Vtiger_Record_Model::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Record_Model::setId方法的具体用法?PHP Vtiger_Record_Model::setId怎么用?PHP Vtiger_Record_Model::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Record_Model
的用法示例。
在下文中一共展示了Vtiger_Record_Model::setId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveRecord
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) {
if (in_array($fieldName, array('header_content', 'content', 'footer_content'))) {
$focus->column_fields[$fieldName] = $fieldValue;
} else {
$focus->column_fields[$fieldName] = decode_html($fieldValue);
}
}
}
}
$focus->mode = $recordModel->get('mode');
$focus->id = $recordModel->getId();
$focus->save($moduleName);
return $recordModel->setId($focus->id);
}
示例2: saveRecord
/**
* Function to save a given record model of the current module
* @param Vtiger_Record_Model $recordModel
*/
public function saveRecord($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);
return $recordModel->setId($focus->id);
}