1 | <?php |
||
14 | class VoteForm extends Model |
||
15 | { |
||
16 | use ModuleTrait; |
||
17 | |||
18 | const ACTION_POSITIVE = 'positive'; |
||
19 | const ACTION_NEGATIVE = 'negative'; |
||
20 | const ACTION_TOGGLE = 'toggle'; |
||
21 | |||
22 | /** |
||
23 | * @var string entity (e.g. "user.like" or "page.voting") |
||
24 | */ |
||
25 | public $entity; |
||
26 | |||
27 | /** |
||
28 | * @var integer target model id |
||
29 | */ |
||
30 | public $targetId; |
||
31 | |||
32 | /** |
||
33 | * @var string +/-? |
||
34 | */ |
||
35 | public $action; |
||
36 | |||
37 | /** |
||
38 | * @return array |
||
39 | * @throws \yii\base\InvalidConfigException |
||
40 | */ |
||
41 | public function rules() |
||
50 | |||
51 | /** |
||
52 | * @return int |
||
53 | */ |
||
54 | public function getValue() |
||
58 | |||
59 | /** |
||
60 | * @return bool |
||
61 | * @throws \yii\base\InvalidConfigException |
||
62 | */ |
||
63 | public function checkModel() |
||
87 | } |
||
88 |