本文整理匯總了PHP中Projects::updateCoaParams方法的典型用法代碼示例。如果您正苦於以下問題:PHP Projects::updateCoaParams方法的具體用法?PHP Projects::updateCoaParams怎麽用?PHP Projects::updateCoaParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Projects
的用法示例。
在下文中一共展示了Projects::updateCoaParams方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: copyProjectCoaStructure
/**
* Copy COA structure from another project
* @param $projectID
* @param $projectFromCopyId
* @return CoaStructure
*/
public static function copyProjectCoaStructure($project_from_id, $project_to_id)
{
$project_from_id = intval($project_from_id);
$project_to_id = intval($project_to_id);
$coaStructure = CoaStructure::model()->findByAttributes(array(
'Project_ID' => $project_from_id,
));
$coaStructureTo = CoaStructure::model()->findByAttributes(array(
'Project_ID' => $project_to_id,
));
if (!$coaStructureTo) {
$coaStructureTo = new CoaStructure();
}
if ($coaStructure !== null && $coaStructureTo !== null) {
$coaStructureTo = clone $coaStructure;
$coaStructureTo->Project_ID = $project_to_id;
$coaStructureTo->setPrimaryKey($project_to_id);
if ($coaStructureTo->validate()) {
$coaStructureTo->save();
Projects::updateCoaParams($project_to_id, $coaStructure->COA_Allow_Manual_Coding, $coaStructure->COA_Break_Character, $coaStructure->COA_Break_Number);
}
}
return $coaStructureTo;
}