示例#1
0
 public static function countUpdated($userID, $timestamp, $deletedCheckLimit = false)
 {
     $table = self::$table;
     $id = self::$idColumn;
     $type = self::$objectType;
     $types = self::$objectTypePlural;
     // First, see what libraries we actually need to check
     Zotero_DB::beginTransaction();
     // All libraries with update times >= $timestamp
     $updateTimes = Zotero_Libraries::getUserLibraryUpdateTimes($userID);
     $updatedLibraryIDs = array();
     foreach ($updateTimes as $libraryID => $lastUpdated) {
         if ($lastUpdated >= $timestamp) {
             $updatedLibraryIDs[] = $libraryID;
         }
     }
     $count = self::getUpdated($userID, $timestamp, $updatedLibraryIDs, true);
     // Make sure we really have fewer than 5
     if ($deletedCheckLimit < 5) {
         $count += Zotero_Sync::countDeletedObjectKeys($userID, $timestamp, $updatedLibraryIDs);
     }
     Zotero_DB::commit();
     return $count;
 }