当前位置: 首页>>代码示例>>PHP>>正文


PHP Employee::setSalary方法代码示例

本文整理汇总了PHP中Employee::setSalary方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::setSalary方法的具体用法?PHP Employee::setSalary怎么用?PHP Employee::setSalary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Employee的用法示例。


在下文中一共展示了Employee::setSalary方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadEmployee

function loadEmployee($id)
{
    // name
    $request = "SELECT * FROM employee WHERE id = {$id}";
    $result = mysql_query($request);
    $row = mysql_fetch_object($result);
    $name = $row->name;
    $address = $row->address;
    $salary = $row->salary;
    $did = $row->did;
    $departments = array();
    $request = "SELECT * FROM department";
    $result = mysql_query($request);
    while ($row = mysql_fetch_object($result)) {
        $department["id"] = $row->id;
        $department["name"] = $row->name;
        if ($row->id == $did) {
            $department["parent"] = true;
        } else {
            $department["parent"] = false;
        }
        $departments[] = $department;
    }
    // create employee object
    $employee = new Employee();
    $employee->setId($id);
    $employee->setName($name);
    $employee->setAddress($address);
    $employee->setSalary($salary);
    $employee->setDepartments($departments);
    // return employee object
    return $employee;
}
开发者ID:nuzil,项目名称:101repo,代码行数:33,代码来源:employeeServer.php

示例2: constructReturnArr

 public function constructReturnArr($res)
 {
     $arr = array();
     $i = 0;
     while ($row = mysql_fetch_assoc($res)) {
         $emp = new Employee();
         $emp->setName($row['name']);
         $emp->setCode($row['code']);
         $emp->setSalary($row['salary']);
         $emp->setGrade($row['grade']);
         $arr[$i] = $emp;
         $i++;
     }
     $this->getConnection()->releaseRes($res);
     return $arr;
 }
开发者ID:fishling,项目名称:empManager,代码行数:16,代码来源:EmployeeAccess.class.php

示例3: loadEmployee

function loadEmployee($jsonObject)
{
    $id = $jsonObject->id;
    // name
    $request = "SELECT * FROM employee WHERE id = {$id}";
    $result = mysql_query($request);
    $row = mysql_fetch_object($result);
    $name = $row->name;
    $address = $row->address;
    $salary = $row->salary;
    // create department object
    $employee = new Employee();
    $employee->setName($name);
    $employee->setAddress($address);
    $employee->setSalary($salary);
    // return department object
    return $employee;
}
开发者ID:nuzil,项目名称:101repo,代码行数:18,代码来源:employeeServer.php


注:本文中的Employee::setSalary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。