| 1 | <?php |
||
| 11 | abstract class BaseNoteService extends BaseService |
||
| 12 | { |
||
| 13 | const REDIS_KEY = 'note:%s'; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var NoteRepository |
||
| 17 | */ |
||
| 18 | protected $noteRepository; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var RedisService |
||
| 22 | */ |
||
| 23 | protected $redisService; |
||
| 24 | |||
| 25 | public function __construct(NoteRepository $noteRepository, RedisService $redisService) |
||
| 30 | |||
| 31 | public function getOneFromDb(int $noteId) |
||
| 35 | |||
| 36 | public function saveInCache($id, $note) |
||
| 42 | |||
| 43 | public function deleteFromCache($noteId) |
||
| 49 | } |
||
| 50 |