1 | <?php |
||
22 | abstract class Service { |
||
23 | |||
24 | protected $mapper; |
||
25 | |||
26 | public function __construct(NewsMapper $mapper){ |
||
29 | |||
30 | |||
31 | /** |
||
32 | * Delete an entity |
||
33 | * @param int $id the id of the entity |
||
34 | * @param string $userId the name of the user for security reasons |
||
35 | * @throws ServiceNotFoundException if the entity does not exist, or there |
||
36 | * are more than one of it |
||
37 | */ |
||
38 | public function delete($id, $userId){ |
||
42 | |||
43 | |||
44 | /** |
||
45 | * Finds an entity by id |
||
46 | * @param int $id the id of the entity |
||
47 | * @param string $userId the name of the user for security reasons |
||
48 | * @throws ServiceNotFoundException if the entity does not exist, or there |
||
49 | * are more than one of it |
||
50 | * @return \OCP\AppFramework\Db\Entity the entity |
||
51 | */ |
||
52 | public function find($id, $userId){ |
||
61 | |||
62 | } |
||
63 |