1 | <?php |
||
2 | |||
3 | /* |
||
4 | * @copyright 2014 Mautic Contributors. All rights reserved |
||
5 | * @author Mautic |
||
6 | * |
||
7 | * @link http://mautic.org |
||
8 | * |
||
9 | * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html |
||
10 | */ |
||
11 | |||
12 | namespace Mautic\FormBundle\Helper; |
||
13 | |||
14 | /** |
||
15 | * Class PointActionHelper. |
||
16 | */ |
||
17 | class PointActionHelper |
||
18 | { |
||
19 | /** |
||
20 | * @param $eventDetails |
||
21 | * @param $action |
||
22 | * |
||
23 | * @return int |
||
24 | */ |
||
25 | public static function validateFormSubmit($eventDetails, $action) |
||
26 | { |
||
27 | $form = $eventDetails->getForm(); |
||
28 | $formId = $form->getId(); |
||
29 | $limitToForms = $action['properties']['forms']; |
||
30 | |||
31 | if (!empty($limitToForms) && !in_array($formId, $limitToForms)) { |
||
32 | //no points change |
||
33 | return false; |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
34 | } |
||
35 | |||
36 | return true; |
||
0 ignored issues
–
show
|
|||
37 | } |
||
38 | } |
||
39 |