| 1 | <?php |
||
| 13 | class Birthday |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var int |
||
| 17 | */ |
||
| 18 | protected $year; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | protected $month; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var int |
||
| 27 | */ |
||
| 28 | protected $day; |
||
| 29 | |||
| 30 | public function __construct($year, $month, $day) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param int $year |
||
| 39 | */ |
||
| 40 | public function setYear($year) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param int $month |
||
| 47 | */ |
||
| 48 | public function setMonth($month) |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param int $day |
||
| 55 | */ |
||
| 56 | public function setDay($day) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return int |
||
| 63 | */ |
||
| 64 | public function getYear() |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return int |
||
| 71 | */ |
||
| 72 | public function getMonth() |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return int |
||
| 79 | */ |
||
| 80 | public function getDay() |
||
| 84 | |||
| 85 | /** |
||
| 86 | * 创建生日. |
||
| 87 | * |
||
| 88 | * @param array $data |
||
| 89 | * |
||
| 90 | * @return Birthday |
||
| 91 | */ |
||
| 92 | public static function createFromArray(array $data) |
||
| 96 | } |
||
| 97 |