Code Duplication    Length = 14-15 lines in 2 locations

apps/dav/lib/CardDAV/CardDavBackend.php 1 location

@@ 850-863 (lines=14) @@
847
	 * @param int $operation 1 = add, 2 = modify, 3 = delete
848
	 * @return void
849
	 */
850
	protected function addChange($addressBookId, $objectUri, $operation) {
851
		$sql = 'INSERT INTO `*PREFIX*addressbookchanges`(`uri`, `synctoken`, `addressbookid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*addressbooks` WHERE `id` = ?';
852
		$stmt = $this->db->prepare($sql);
853
		$stmt->execute([
854
			$objectUri,
855
			$addressBookId,
856
			$operation,
857
			$addressBookId
858
		]);
859
		$stmt = $this->db->prepare('UPDATE `*PREFIX*addressbooks` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
860
		$stmt->execute([
861
			$addressBookId
862
		]);
863
	}
864
865
	private function readBlob($cardData) {
866
		if (is_resource($cardData)) {

apps/dav/lib/CalDAV/CalDavBackend.php 1 location

@@ 1978-1992 (lines=15) @@
1975
	 * @param int $operation 1 = add, 2 = modify, 3 = delete.
1976
	 * @return void
1977
	 */
1978
	protected function addChange($calendarId, $objectUri, $operation) {
1979
1980
		$stmt = $this->db->prepare('INSERT INTO `*PREFIX*calendarchanges` (`uri`, `synctoken`, `calendarid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*calendars` WHERE `id` = ?');
1981
		$stmt->execute([
1982
			$objectUri,
1983
			$calendarId,
1984
			$operation,
1985
			$calendarId
1986
		]);
1987
		$stmt = $this->db->prepare('UPDATE `*PREFIX*calendars` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
1988
		$stmt->execute([
1989
			$calendarId
1990
		]);
1991
1992
	}
1993
1994
	/**
1995
	 * Parses some information from calendar objects, used for optimized