/** * 更新一条数据 * * @param Data $data * @param IStorage $storage * @access protected * @return boolean */ protected function doUpdate(Data $data, IStorage $storage = null, $collection = null) { $meta = $this->getMeta(); $this->getStorage()->update($meta->getCollection(), array($meta->getPrimaryKey() => $data->id()), array('$set' => $this->propsToRecord($data->toArray())), array('safe' => true)); return true; }