diff --git a/db/devicemapper.php b/db/devicemapper.php index ac36044..9995553 100644 --- a/db/devicemapper.php +++ b/db/devicemapper.php @@ -11,8 +11,10 @@ public function __construct(IDBConnection $db) { } /** + * @param string $hash * @throws \OCP\AppFramework\Db\DoesNotExistException if not found * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result + * @return Device */ public function findByHash($hash) { $sql = 'SELECT * FROM `*PREFIX*maps_location_track_users` '. @@ -21,8 +23,10 @@ public function findByHash($hash) { } /** + * @param int $id * @throws \OCP\AppFramework\Db\DoesNotExistException if not found * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result + * @return Device */ public function findById($id) { $sql = 'SELECT * FROM `*PREFIX*maps_location_track_users` '. @@ -30,6 +34,12 @@ public function findById($id) { return $this->findEntity($sql, [$id]); } + /** + * @param string $userId + * @param int $limit + * @param int $offset + * @return Device[] + */ public function findAll($userId, $limit=null, $offset=null) { $sql = 'SELECT * FROM `*PREFIX*maps_location_track_users`'. 'WHERE `user_id` = ?'; diff --git a/db/locationmapper.php b/db/locationmapper.php index d43e0f1..7ac1493 100644 --- a/db/locationmapper.php +++ b/db/locationmapper.php @@ -11,8 +11,10 @@ public function __construct(IDBConnection $db) { } /** + * @param int $id * @throws \OCP\AppFramework\Db\DoesNotExistException if not found * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result + * @return Location */ public function find($id) { $sql = 'SELECT * FROM `*PREFIX*maps_locations` '. @@ -20,6 +22,14 @@ public function find($id) { return $this->findEntity($sql, [$id]); } + /** + * @param string $deviceHash + * @param string $from + * @param string $until + * @param int $limit + * @param int $offset + * @return Location[] + */ public function findBetween($deviceHash, $from, $until, $limit=null, $offset=null) { $sql = 'SELECT * FROM `*PREFIX*maps_locations` '. 'WHERE `device_hash` = ?'. @@ -27,7 +37,11 @@ public function findBetween($deviceHash, $from, $until, $limit=null, $offset=nul return $this->findEntities($sql, [$deviceHash, $from, $until], $limit, $offset); } - + /** + * @param int $limit + * @param int $offset + * @return Location[] + */ public function findAll($limit=null, $offset=null) { $sql = 'SELECT * FROM `*PREFIX*maps_locations`'; return $this->findEntities($sql, $limit, $offset);