group) { $this->_error = "Failed get group"; return false; } if (!is_string($this->group)) { $this->_error = "Failed get group: {$this->group}"; return false; } if (!$this->target) { $this->_error = "Failed get target"; return false; } if (!is_string($this->target)) { $this->_error = "Failed get target: {$this->target}"; return false; } return true; } /** * データ読み込み * @param mixed int of id or resource of query result * @return boolean true if success, false if fault */ function load($id) { $result = parent::load($id); if ($result) { $this->publish = $this->publish ? true : false; } return $result; } /** * データ登録 * @return boolean */ function store() { $this->publish = $this->publish ? 1 : 0; $result = parent::store(); $this->publish = $this->publish ? true : false; return $result; } /** * データ検索 * @param int of offset * @param int of limit * @return boolean true if success, false if fault */ function find($offset=0,$limit=0) { if (isset($this->publish)) { $this->publish = $this->publish ? 1 : 0; } $result = parent::find($offset, $limit); if (isset($this->publish)) { $this->publish = $this->publish ? 1 : 0; } return $result; } }