1 | <?php |
||
9 | class DatabaseService implements SubscriptionProvider |
||
10 | { |
||
11 | /** |
||
12 | * @var \Neo\EarlyAccess\Contracts\Subscription\SubscriptionRepository |
||
13 | */ |
||
14 | protected $repository; |
||
15 | |||
16 | /** |
||
17 | * DatabaseSubscriptionService constructor. |
||
18 | * |
||
19 | * @param \Neo\EarlyAccess\Contracts\Subscription\SubscriptionRepository $repository |
||
20 | */ |
||
21 | public function __construct(SubscriptionRepository $repository) |
||
25 | |||
26 | /** |
||
27 | * Adds a new email to the subscribers list. |
||
28 | * |
||
29 | * @param string $email |
||
30 | * @param string|null $name |
||
31 | * @return bool |
||
32 | */ |
||
33 | public function add(string $email, string $name = null): bool |
||
37 | |||
38 | /** |
||
39 | * Removes an email from the subscribers list. |
||
40 | * |
||
41 | * @param string $email |
||
42 | * @return bool |
||
43 | */ |
||
44 | public function remove(string $email): bool |
||
48 | |||
49 | /** |
||
50 | * Verifies a subscribers email address. |
||
51 | * |
||
52 | * @param string $email |
||
53 | * @return bool |
||
54 | */ |
||
55 | public function verify(string $email): bool |
||
59 | |||
60 | /** |
||
61 | * Find a subscriber using their email address. |
||
62 | * |
||
63 | * @param string $email |
||
64 | * @return \Neo\EarlyAccess\Subscriber|false |
||
65 | */ |
||
66 | public function findByEmail(string $email) |
||
72 | } |
||
73 |