Completed
Push — erdiko2 ( 719271...84f584 )
by John
05:49
created

Users   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUsers() 0 4 1
A getUsersOld() 0 6 1
1
<?php
2
/**
3
 * Users Model
4
 *
5
 * Service model for the users table
6
 * 
7
 * @category    app
8
 * @package     models
9
 * @copyright   Copyright (c) 2016, Arroyo Labs, http://www.arroyolabs.com
10
 * @author      John Arroyo, [email protected]
11
 */
12
namespace app\models;
13
14
class Users 
15
{
16
    use \erdiko\doctrine\EntityTraits; // This adds some convenience methods
17
18
    public function getUsers()
19
    {
20
        return $this->getRepository('app\entities\User')->findAll(); // The easy (convenient) way
21
    }
22
23
    public function getUsersOld()
24
    {
25
        // The old fashioned way (typical doctrine use)
26
        $entityManager = \erdiko\doctrine\EntityManager::getEntityManager();
27
        return $entityManager->getRepository('app\entities\User')->findAll();
28
    }
29
}