Code Duplication    Length = 15-18 lines in 2 locations

lib/private/BackgroundJob/JobList.php 1 location

@@ 219-233 (lines=15) @@
216
	 * @param int $id
217
	 * @return IJob|null
218
	 */
219
	public function getById($id) {
220
		$query = $this->connection->getQueryBuilder();
221
		$query->select('*')
222
			->from('jobs')
223
			->where($query->expr()->eq('id', $query->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
224
		$result = $query->execute();
225
		$row = $result->fetch();
226
		$result->closeCursor();
227
228
		if ($row) {
229
			return $this->buildJob($row);
230
		} else {
231
			return null;
232
		}
233
	}
234
235
	/**
236
	 * get the job object from a row in the db

apps/federatedfilesharing/lib/FederatedShareProvider.php 1 location

@@ 749-766 (lines=18) @@
746
	 * @return array
747
	 * @throws ShareNotFound
748
	 */
749
	private function getRawShare($id) {
750
751
		// Now fetch the inserted share and create a complete share object
752
		$qb = $this->dbConnection->getQueryBuilder();
753
		$qb->select('*')
754
			->from('share')
755
			->where($qb->expr()->eq('id', $qb->createNamedParameter($id)));
756
757
		$cursor = $qb->execute();
758
		$data = $cursor->fetch();
759
		$cursor->closeCursor();
760
761
		if ($data === false) {
762
			throw new ShareNotFound;
763
		}
764
765
		return $data;
766
	}
767
768
	/**
769
	 * Create a share object from an database row