本文整理汇总了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;
}