Passed
Push — develop ( 0b9e5b...e73b46 )
by Nikolay
04:34
created

UsersController::availableAction()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
use MikoPBX\AdminCabinet\Controllers\BaseController;
4
use MikoPBX\Common\Models\Users;
5
6
/**
7
 * Copyright (C) MIKO LLC - All Rights Reserved
8
 * Unauthorized copying of this file, via any medium is strictly prohibited
9
 * Proprietary and confidential
10
 * Written by Nikolay Beketov, 5 2018
11
 *
12
 */
13
14
15
16
class UsersController extends BaseController {
17
18
    /**
19
     * Проверка на доступность емейл адреса
20
     */
21
    public function availableAction($email):void
22
    {
23
        $result = true;
24
        $extension = Users::findFirstByEmail($email);
25
        if ($extension) {
26
            $result = false;
27
        }
28
        $this->view->emailAvailable=$result;
29
    }
30
31
}