Completed
Push — master ( 632fa2...fc556e )
by Julito
34:44
created

UserManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findUserByConfirmationToken() 0 4 1
A findUserByOfficialCode() 0 5 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\UserBundle\Entity\Manager;
5
6
use Chamilo\UserBundle\Entity\User;
7
use Sonata\UserBundle\Entity\UserManager as BaseUserManager;
8
9
/**
10
 * Class UserManager
11
 *
12
 * @package Chamilo\UserBundle\Entity\Manager
13
 */
14
class UserManager extends BaseUserManager
15
{
16
    /**
17
     * Finds a user either by confirmation token
18
     *
19
     * @param string $token
20
     *
21
     * @return User
22
     */
23
    public function findUserByConfirmationToken($token)
24
    {
25
        return $this->findUserBy(array('confirmationToken' => $token));
26
    }
27
28
    /**
29
     * @param string $code
30
     * @return User
31
     */
32
    public function findUserByOfficialCode($code)
33
    {
34
        $criteria = ['officialCode' => $code ];
35
        return $this->findUserBy($criteria);
36
    }
37
}
38