123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- /**
- * Created by PhpStorm.
- * User: robin
- * Date: 2/22/16
- * Time: 9:25 PM
- */
-
- namespace Luticate\Utils\Dbo;
-
-
- use Luticate\Utils\LuBusiness;
- use Luticate\Utils\LuDbo;
-
- class LuIntDbo extends LuDbo
- {
- /**
- * @var int
- */
- private $_value;
-
- /**
- * @return int
- */
- public function getInt()
- {
- return $this->_value;
- }
-
- /**
- * @param int $value
- */
- public function setInt($value)
- {
- $this->_value = $value;
- }
-
- function jsonSerialize()
- {
- return $this->_value;
- }
-
- public static function jsonDeserialize($json)
- {
- if (!is_numeric($json) || intval($json) != $json) {
- LuBusiness::badInput("Invalid integer value");
- }
- $val = new self();
- $val->setInt(intval($json));
- return $val;
- }
-
- public static function generateSample()
- {
- return 42;
- }
- }
|