lib/private/BackgroundJob/JobList.php 1 location
|
@@ 224-238 (lines=15) @@
|
| 221 |
|
* @param int $id |
| 222 |
|
* @return IJob|null |
| 223 |
|
*/ |
| 224 |
|
public function getById($id) { |
| 225 |
|
$query = $this->connection->getQueryBuilder(); |
| 226 |
|
$query->select('*') |
| 227 |
|
->from('jobs') |
| 228 |
|
->where($query->expr()->eq('id', $query->createNamedParameter($id, IQueryBuilder::PARAM_INT))); |
| 229 |
|
$result = $query->execute(); |
| 230 |
|
$row = $result->fetch(); |
| 231 |
|
$result->closeCursor(); |
| 232 |
|
|
| 233 |
|
if ($row) { |
| 234 |
|
return $this->buildJob($row); |
| 235 |
|
} else { |
| 236 |
|
return null; |
| 237 |
|
} |
| 238 |
|
} |
| 239 |
|
|
| 240 |
|
/** |
| 241 |
|
* get the job object from a row in the db |
apps/federatedfilesharing/lib/FederatedShareProvider.php 1 location
|
@@ 818-835 (lines=18) @@
|
| 815 |
|
* @return array |
| 816 |
|
* @throws ShareNotFound |
| 817 |
|
*/ |
| 818 |
|
private function getRawShare($id) { |
| 819 |
|
|
| 820 |
|
// Now fetch the inserted share and create a complete share object |
| 821 |
|
$qb = $this->dbConnection->getQueryBuilder(); |
| 822 |
|
$qb->select('*') |
| 823 |
|
->from($this->shareTable) |
| 824 |
|
->where($qb->expr()->eq('id', $qb->createNamedParameter($id))); |
| 825 |
|
|
| 826 |
|
$cursor = $qb->execute(); |
| 827 |
|
$data = $cursor->fetch(); |
| 828 |
|
$cursor->closeCursor(); |
| 829 |
|
|
| 830 |
|
if ($data === false) { |
| 831 |
|
throw new ShareNotFound; |
| 832 |
|
} |
| 833 |
|
|
| 834 |
|
return $data; |
| 835 |
|
} |
| 836 |
|
|
| 837 |
|
/** |
| 838 |
|
* Create a share object from an database row |