| @@ 22-33 (lines=12) @@ | ||
| 19 | * @param string $name |
|
| 20 | * @return null|string |
|
| 21 | */ |
|
| 22 | public function __get($name) |
|
| 23 | { |
|
| 24 | $property = $this->propertyNormalize($name); |
|
| 25 | ||
| 26 | if (isset($this->data[$property])) { |
|
| 27 | return $this->data[$property]; |
|
| 28 | } else { |
|
| 29 | trigger_error(sprintf('Undefined property: %s::%s', __CLASS__, '$'.$name), E_USER_NOTICE); |
|
| 30 | ||
| 31 | return; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Phương thức hổ trợ bảo vệ các thuộc tính của đối tượng từ dữ liệu gửi về từ VNPay. |
|
| @@ 42-51 (lines=10) @@ | ||
| 39 | * @param mixed $value |
|
| 40 | * @return null|string |
|
| 41 | */ |
|
| 42 | public function __set($name, $value) |
|
| 43 | { |
|
| 44 | $property = $this->propertyNormalize($name); |
|
| 45 | ||
| 46 | if (isset($this->data[$property])) { |
|
| 47 | trigger_error(sprintf('Undefined property: %s::%s', __CLASS__, '$'.$name), E_USER_NOTICE); |
|
| 48 | } else { |
|
| 49 | $this->$name = $value; |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Phương thức hổ trợ chuyển đổi property `vpcAbc` thành `vpc_Abc`. |
|