| Total Complexity | 6 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class DeleteAccountForm extends Model |
||
| 12 | { |
||
| 13 | public $password; |
||
| 14 | private $user; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Creates a form model |
||
| 18 | * |
||
| 19 | * @param object $user |
||
| 20 | * @param array $config name-value pairs that will be used to initialize the object properties |
||
| 21 | */ |
||
| 22 | public function __construct(\common\interfaces\UserInterface $user, $config = []) { |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @inheritdoc |
||
| 29 | */ |
||
| 30 | public function rules() |
||
| 31 | { |
||
| 32 | return [ |
||
| 33 | ['password', 'required'], |
||
| 34 | ['password', 'string', 'min' => 6], |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function attributeLabels() { |
||
| 39 | return [ |
||
| 40 | 'password' => 'Password' |
||
| 41 | ]; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * saves user's profile info. |
||
| 46 | * |
||
| 47 | * @return User|null the saved model or null if saving fails |
||
| 48 | */ |
||
| 49 | public function deleteAccount() |
||
| 58 | } |
||
| 59 | } |
||
| 60 |