lib/private/Repair/Owncloud/SaveAccountsTableData.php
/**
	 * @param int $offset
	 * @return int Number of copied users
	 */
@param int $offset
@return int Number of copied users
@param int $offset @return int Number of copied users
protected function runStep($offset) {
		$query = $this->db->getQueryBuilder();
		$query->select('*')
			->from('accounts')
			->orderBy('id')
			->setMaxResults(self::BATCH_SIZE);
		if ($offset > 0) {
			$query->setFirstResult($offset);
		}
		$result = $query->execute();
		$update = $this->db->getQueryBuilder();
		$update->update('users')
			->set('displayname', $update->createParameter('displayname'))
			->where($update->expr()->eq('uid', $update->createParameter('userid')));
		$updatedUsers = 0;
		while ($row = $result->fetch()) {
			try {
				$this->migrateUserInfo($update, $row);
			} catch (PreConditionNotMetException $e) {
			} catch (\UnexpectedValueException $e) {
			}
			$updatedUsers++;
		}
		$result->closeCursor();
		return $updatedUsers;
	}
protected function runStep ( $ offset ) { $ query = $ this -> db -> getQueryBuilder ( ) ; $ query -> select ( '*' ) -> from ( 'accounts' ) -> orderBy ( 'id' ) -> setMaxResults ( self :: BATCH_SIZE ) ; if ( $ offset > 0 ) { $ query -> setFirstResult ( $ offset ) ; } $ result = $ query -> execute ( ) ; $ update = $ this -> db -> getQueryBuilder ( ) ; $ update -> update ( 'users' ) -> set ( 'displayname' , $ update -> createParameter ( 'displayname' ) ) -> where ( $ update -> expr ( ) -> eq ( 'uid' , $ update -> createParameter ( 'userid' ) ) ) ; $ updatedUsers = 0 ; while ( $ row = $ result -> fetch ( ) ) { try { $ this -> migrateUserInfo ( $ update , $ row ) ; } catch ( PreConditionNotMetException $ e ) { } catch ( \ UnexpectedValueException $ e ) { } $ updatedUsers ++ ; } $ result -> closeCursor ( ) ; return $ updatedUsers ; }
@param int $offset
 @return int Number of copied users
@param int $offset @return int Number of copied users
// Ignore and continue // Ignore and continue