2015-02-22 */ class PhalApi_ModelQuery { /** * @var boolean $readCache 是否读取缓存 */ public $readCache = true; /** * @var boolean $writeCache 是否写入缓存 */ public $writeCache = true; /** * @var string/int ID */ public $id; /** * @var int $timestamp 时间戳 */ public $timestamp; public function __construct($queryArr = array()) { $this->timestamp = $_SERVER['REQUEST_TIME']; if (DI()->debug) { $this->readCache = FALSE; $this->writeCache = FALSE; } foreach ($queryArr as $key => $value) { $this->$key = $value; } } public function __set($name, $value) { $this->$name = $value; } public function __get($name) { if (isset($this->$name)) { return $this->$name; } return NULL; } public function toArray() { return get_object_vars($this); } }