示例#1
0
文件: mongo.php 项目: neoisldl/Onion
 /**
  * 更新一条数据
  *
  * @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;
 }