1 | <?php |
||
10 | class CaptchaService implements CaptchaServiceInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $config; |
||
16 | |||
17 | /** |
||
18 | * @var \eZ\Publish\API\Repository\ContentTypeService |
||
19 | */ |
||
20 | protected $contentTypeService; |
||
21 | |||
22 | /** |
||
23 | * CaptchaService constructor. |
||
24 | * |
||
25 | * @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentTypeService |
||
26 | * @param array $config |
||
27 | */ |
||
28 | public function __construct(ContentTypeService $contentTypeService, $config = []) |
||
33 | |||
34 | /** |
||
35 | * @inheritdoc |
||
36 | */ |
||
37 | public function isEnabled(Location $location) |
||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | public function getSiteKey(Location $location) |
||
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | public function getCaptcha(Location $location) |
||
88 | |||
89 | /** |
||
90 | * Returns filtered config for current Location |
||
91 | * |
||
92 | * @param \eZ\Publish\API\Repository\Values\Content\Location $location |
||
93 | * |
||
94 | * @return array |
||
95 | * |
||
96 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
97 | */ |
||
98 | protected function getConfig(Location $location) |
||
106 | |||
107 | /** |
||
108 | * Returns filtered config for current ContentType |
||
109 | * |
||
110 | * @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType |
||
111 | * |
||
112 | * @return array |
||
113 | */ |
||
114 | protected function getConfigForContentType(ContentType $contentType) |
||
122 | |||
123 | /** |
||
124 | * Checks if override exist for given ContentType |
||
125 | * |
||
126 | * @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType |
||
127 | * |
||
128 | * @return bool |
||
129 | */ |
||
130 | protected function hasConfigForContentType(ContentType $contentType) |
||
140 | |||
141 | /** |
||
142 | * Helper method for retrieving ContentType from Location |
||
143 | * |
||
144 | * @param \eZ\Publish\API\Repository\Values\Content\Location $location |
||
145 | * |
||
146 | * @return \eZ\Publish\API\Repository\Values\ContentType\ContentType |
||
147 | * |
||
148 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
149 | */ |
||
150 | protected function getContentType(Location $location) |
||
155 | } |
||
156 |