123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <?php
- class Employee implements JsonSerializable {
- private $id;
- private $name;
- private $createTime;
- private $number;
- private $mobile;
- private $email;
- private $idCardNo;
- private $realName;
- private $companies;
- public function jsonSerialize() {
- $data = [];
- foreach ($this as $key=>$val){
- if ($val !== null) $data[$key] = $val;
- }
- if(sizeof($data) < 1){
- return null;
- }
- return $data;
- }
- /**
- * @return mixed
- */
- public function getNumber()
- {
- return $this->number;
- }
- /**
- * @param mixed $number
- */
- public function setNumber($number)
- {
- $this->number = $number;
- }
- /**
- * @return mixed
- */
- public function getIdCardNo()
- {
- return $this->idCardNo;
- }
- /**
- * @param mixed $idCardNo
- */
- public function setIdCardNo($idCardNo)
- {
- $this->idCardNo = $idCardNo;
- }
- /**
- * @return mixed
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * @param mixed $id
- */
- public function setId($id)
- {
- $this->id = $id;
- }
- /**
- * @return mixed
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * @param mixed $name
- */
- public function setName($name)
- {
- $this->name = $name;
- }
- /**
- * @return mixed
- */
- public function getCreateTime()
- {
- return $this->createTime;
- }
- /**
- * @param mixed $createTime
- */
- public function setCreateTime($createTime)
- {
- $this->createTime = $createTime;
- }
- /**
- * @return mixed
- */
- public function getMobile()
- {
- return $this->mobile;
- }
- /**
- * @param mixed $mobile
- */
- public function setMobile($mobile)
- {
- $this->mobile = $mobile;
- }
- /**
- * @return mixed
- */
- public function getEmail()
- {
- return $this->email;
- }
- /**
- * @param mixed $email
- */
- public function setEmail($email)
- {
- $this->email = $email;
- }
- /**
- * @return mixed
- */
- public function getRealName()
- {
- return $this->realName;
- }
- /**
- * @param mixed $realName
- */
- public function setRealName($realName)
- {
- $this->realName = $realName;
- }
- /**
- * @return mixed
- */
- public function getCompanies()
- {
- return $this->companies;
- }
- /**
- * @param mixed $companies
- */
- public function setCompanies($companies)
- {
- $this->companies = $companies;
- }
- }
|