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

Users::getUsers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
}