Code Duplication    Length = 14-15 lines in 2 locations

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

@@ 730-743 (lines=14) @@
727
	 * @param int $operation 1 = add, 2 = modify, 3 = delete
728
	 * @return void
729
	 */
730
	protected function addChange($addressBookId, $objectUri, $operation) {
731
		$sql = 'INSERT INTO `*PREFIX*addressbookchanges`(`uri`, `synctoken`, `addressbookid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*addressbooks` WHERE `id` = ?';
732
		$stmt = $this->db->prepare($sql);
733
		$stmt->execute([
734
			$objectUri,
735
			$addressBookId,
736
			$operation,
737
			$addressBookId
738
		]);
739
		$stmt = $this->db->prepare('UPDATE `*PREFIX*addressbooks` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
740
		$stmt->execute([
741
			$addressBookId
742
		]);
743
	}
744
745
	private function readBlob($cardData) {
746
		if (is_resource($cardData)) {

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

@@ 1474-1488 (lines=15) @@
1471
	 * @param int $operation 1 = add, 2 = modify, 3 = delete.
1472
	 * @return void
1473
	 */
1474
	protected function addChange($calendarId, $objectUri, $operation) {
1475
1476
		$stmt = $this->db->prepare('INSERT INTO `*PREFIX*calendarchanges` (`uri`, `synctoken`, `calendarid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*calendars` WHERE `id` = ?');
1477
		$stmt->execute([
1478
			$objectUri,
1479
			$calendarId,
1480
			$operation,
1481
			$calendarId
1482
		]);
1483
		$stmt = $this->db->prepare('UPDATE `*PREFIX*calendars` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
1484
		$stmt->execute([
1485
			$calendarId
1486
		]);
1487
1488
	}
1489
1490
	/**
1491
	 * Parses some information from calendar objects, used for optimized