本文整理汇总了PHP中Application_Model_User::setModel方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_User::setModel方法的具体用法?PHP Application_Model_User::setModel怎么用?PHP Application_Model_User::setModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_User
的用法示例。
在下文中一共展示了Application_Model_User::setModel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setModel
private function setModel($row)
{
$model = new Application_Model_Request();
$model->setId($row->id)->setDepartmentId($row->department_id)->setRequest($row->request)->setStatus($row->status)->setRequestedBy($row->requested_by)->setRemarks($row->remarks)->setUserId($row->user_id)->setAddedon($row->addedon)->setUpdatedon($row->updatedon);
if ($department = $row->findParentRow("Application_Model_DbTable_Department")) {
$model->setDepartment($department->title);
} else {
$model->setDepartment("N/A");
}
if ($user = $row->findParentRow("Application_Model_DbTable_User", "User")) {
$userM = new Application_Model_User();
$user = $userM->setModel($user);
$model->setUser($user);
} else {
$model->setUser(null);
}
if ($user = $row->findParentRow("Application_Model_DbTable_User", "RequestedBy")) {
$userM = new Application_Model_User();
$user = $userM->setModel($user);
$model->setRequestedByObj($user);
} else {
$model->setRequestedByObj(null);
}
return $model;
}
示例2: setModel
private function setModel($row)
{
$model = new Application_Model_Appriciation();
$model->setId($row->id)->setUserId($row->user_id)->setRemarks($row->remarks)->setAppriciationDate($row->appriciation_date)->setAppriciationTypeId($row->appriciation_type_id)->setAddedon($row->addedon)->setUpdatedon($row->updatedon);
if ($appriciationType = $row->findParentRow("Application_Model_DbTable_AppriciationType", 'AppriciationType')) {
$model->setAppriciationType($appriciationType->title);
}
if ($user = $row->findParentRow("Application_Model_DbTable_User", 'User')) {
$userM = new Application_Model_User();
$model->setUser($userM->setModel($user));
}
return $model;
}