1 | <?php |
||
14 | abstract class Activation extends \yii\base\Model |
||
15 | { |
||
16 | /** |
||
17 | * The activation code |
||
18 | * @var string $activation_code |
||
19 | */ |
||
20 | public $activation_code; |
||
21 | |||
22 | /** |
||
23 | * The user associated to the model |
||
24 | * @var User $user |
||
25 | */ |
||
26 | private $user; |
||
27 | |||
28 | /** |
||
29 | * Validation rules |
||
30 | * @return array |
||
31 | */ |
||
32 | public function rules() |
||
39 | |||
40 | /** |
||
41 | * Validates that the activation code belongs to a user and is not expired |
||
42 | * @param string $attribute |
||
43 | * @param array $params |
||
44 | */ |
||
45 | public function belongsToUserAndIsNotExpired($attribute, $params) |
||
64 | |||
65 | /** |
||
66 | * Activates the user |
||
67 | * @return boolean |
||
68 | */ |
||
69 | public function activate() |
||
81 | } |
||
82 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.