1 | <?php |
||
15 | class CaptchaService implements CaptchaServiceInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $config; |
||
21 | |||
22 | /** |
||
23 | * @var \eZ\Publish\API\Repository\ContentTypeService |
||
24 | */ |
||
25 | protected $contentTypeService; |
||
26 | |||
27 | /** |
||
28 | * CaptchaService constructor. |
||
29 | * |
||
30 | * @param \eZ\Publish\API\Repository\ContentTypeService $contentTypeService |
||
31 | * @param array $config |
||
32 | */ |
||
33 | public function __construct(ContentTypeService $contentTypeService, $config = []) |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function isEnabled(Location $location): bool |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function getSiteKey(Location $location): string |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function getCaptcha(Location $location): CaptchaValue |
||
92 | |||
93 | /** |
||
94 | * Returns filtered config for current Location. |
||
95 | * |
||
96 | * @param \eZ\Publish\API\Repository\Values\Content\Location $location |
||
97 | * |
||
98 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | protected function getConfig(Location $location) |
||
110 | |||
111 | /** |
||
112 | * Returns filtered config for current ContentType. |
||
113 | * |
||
114 | * @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType |
||
115 | * |
||
116 | * @return array |
||
117 | */ |
||
118 | protected function getConfigForContentType(ContentType $contentType) |
||
126 | |||
127 | /** |
||
128 | * Checks if override exist for given ContentType. |
||
129 | * |
||
130 | * @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType |
||
131 | * |
||
132 | * @return bool |
||
133 | */ |
||
134 | protected function hasConfigForContentType(ContentType $contentType) |
||
144 | |||
145 | /** |
||
146 | * Helper method for retrieving ContentType from Location. |
||
147 | * |
||
148 | * @param \eZ\Publish\API\Repository\Values\Content\Location $location |
||
149 | * |
||
150 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
151 | * |
||
152 | * @return \eZ\Publish\API\Repository\Values\ContentType\ContentType |
||
153 | */ |
||
154 | protected function getContentType(Location $location) |
||
159 | } |
||
160 |