示例#1
0
 /**
  * @see BackendAdapter::updateFile
  */
 public function updateFile(File $file)
 {
     $document = $file->toArray();
     $document['resource_id'] = $file->getResource()->getId();
     $document['date_created'] = $document['date_created']->format('Y-m-d H:i:s');
     unset($document['resource']);
     $this->update('files', $file->getId(), $document);
     return true;
 }
示例#2
0
 /**
  * @see BackendAdapter::updateFile
  */
 public function updateFile(File $file)
 {
     $document = $file->toArray();
     $document['resource_id'] = $file->getResource()->getId();
     unset($document['id']);
     unset($document['resource']);
     $document['date_created'] = new MongoDate($document['date_created']->getTimestamp());
     $ret = $this->getMongo()->files->update(array('_id' => new MongoId($file->getId())), $document, array('w' => true));
     return (bool) $ret['n'];
 }