本文整理汇总了PHP中CRM_Core_DAO_UFJoin::save方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_DAO_UFJoin::save方法的具体用法?PHP CRM_Core_DAO_UFJoin::save怎么用?PHP CRM_Core_DAO_UFJoin::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_DAO_UFJoin
的用法示例。
在下文中一共展示了CRM_Core_DAO_UFJoin::save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public static function create(&$params)
{
$vacancy = new self();
if (!empty($params['id'])) {
CRM_Core_DAO::executeQuery("DELETE FROM civicrm_hrvacancy_stage WHERE vacancy_id = {$params['id']}");
CRM_Core_DAO::executeQuery("DELETE FROM civicrm_hrvacancy_permission WHERE vacancy_id = {$params['id']}");
}
$vacancyParams = CRM_HRRecruitment_BAO_HRVacancy::formatParams($params);
$entityName = 'HRVacancy';
$hook = empty($params['id']) ? 'create' : 'edit';
CRM_Utils_Hook::pre($hook, $entityName, CRM_Utils_Array::value('id', $params), $params);
if (!empty($params['id'])) {
$vacancy->find($params['id']);
$vacancy->created_date = $vacancy->created_date ? CRM_Utils_Date::processDate($vacancy->created_date) : date('YmdHis');
$vacancy->created_id = $vacancy->created_id ? $vacancy->created_id : CRM_Core_Session::singleton()->get('userID');
} else {
$vacancyParams['created_date'] = date('YmdHis');
$vacancyParams['created_id'] = CRM_Core_Session::singleton()->get('userID');
}
$vacancy->copyValues($vacancyParams);
$vacancy->save();
if (isset($params['stages']) && count($params['stages'])) {
foreach ($params['stages'] as $key => $stage_id) {
$dao = new CRM_HRRecruitment_DAO_HRVacancyStage();
$dao->case_status_id = $stage_id;
$dao->vacancy_id = $vacancy->id;
$dao->weight = $key + 1;
$dao->save();
}
}
foreach (array('application_profile', 'evaluation_profile') as $profileName) {
if (!empty($params[$profileName])) {
$dao = new CRM_Core_DAO_UFJoin();
$dao->module = 'Vacancy';
$dao->entity_table = 'civicrm_hrvacancy';
$dao->entity_id = $vacancy->id;
$dao->module_data = $profileName;
if (!empty($params['id'])) {
$dao->find(TRUE);
}
$dao->uf_group_id = $params[$profileName];
$dao->save();
}
}
if (!empty($params['permission']) && !empty($params['permission_contact_id'])) {
foreach ($params['permission'] as $key => $permission) {
if ($permission && $params['permission_contact_id'][$key]) {
$dao = new CRM_HRRecruitment_DAO_HRVacancyPermission();
$dao->contact_id = $params['permission_contact_id'][$key];
$dao->permission = $permission;
$dao->vacancy_id = $vacancy->id;
$dao->save();
}
}
}
CRM_Utils_Hook::post($hook, $entityName, $vacancy->id, $vacancy);
return $vacancy;
}
示例2:
/**
* Takes an associative array and creates a uf join object.
*
* @param array $params
* (reference) an assoc array of name/value pairs.
*
* @return CRM_Core_DAO_UFJoin
*/
public static function &create($params)
{
// see if a record exists with the same weight
$id = self::findJoinEntryId($params);
if ($id) {
$params['id'] = $id;
}
$dao = new CRM_Core_DAO_UFJoin();
$dao->copyValues($params);
if ($params['uf_group_id']) {
$dao->save();
} else {
$dao->delete();
}
return $dao;
}
示例3: addUFJoin
/**
* Function takes an associative array and creates a ufjoin record for ufgroup.
*
* @param array $params
* (reference) an assoc array of name/value pairs.
*
* @return CRM_Core_BAO_UFJoin
*/
public static function addUFJoin(&$params)
{
$ufJoin = new CRM_Core_DAO_UFJoin();
$ufJoin->copyValues($params);
$ufJoin->save();
return $ufJoin;
}
示例4: addUFJoin
/**
* Function takes an associative array and creates a ufjoin record for ufgroup
*
* @param array $params (reference) an assoc array of name/value pairs
*
* @return object CRM_Core_BAO_UFJoin object
* @access public
* @static
*/
static function addUFJoin(&$params)
{
require_once 'CRM/Core/DAO/UFJoin.php';
$ufJoin = new CRM_Core_DAO_UFJoin();
$ufJoin->copyValues($params);
$ufJoin->save();
return $ufJoin;
}