1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- /**
- * Created by PhpStorm.
- * User: robin
- * Date: 2/22/16
- * Time: 9:40 PM
- */
-
- namespace Luticate\Utils\Dbo;
-
- class LuBoolDboArray extends LuDboArray
- {
- /**
- * @var int[]
- */
- protected $_array;
- public function getArray()
- {
- return $this->_array;
- }
- public function setArray($value)
- {
- $this->_array = $value;
- }
-
- public function jsonSerialize()
- {
- return $this->_array;
- }
-
- public static function jsonDeserialize($json)
- {
- if (!is_array($json)) {
- throw new LuDboDeserializeException("Invalid array value");
- }
- $dbo = new self();
- $array = [];
- foreach ($json as $data) {
- $array[] = LuBoolDbo::jsonDeserialize($data)->getBool();
- }
- $dbo->setArray($array);
- return $dbo;
- }
-
- public static function generateSample()
- {
- return [
- LuBoolDbo::generateSample(),
- LuBoolDbo::generateSample()
- ];
- }
-
- }
|