~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Factory/ApplicationFactory.php

  • Committer: Dan Garner
  • Date: 2016-04-28 13:57:49 UTC
  • mfrom: (494.1.28)
  • Revision ID: git-v1:1d7f53c2f62d46799f33b7356d8f45ff10668e26
Merge pull request #167 from dasgarner/feature/test-suite

Feature/test suite

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
    }
90
90
 
91
91
    /**
 
92
     * Get by Name
 
93
     * @param $name
 
94
     * @return Application
 
95
     * @throws NotFoundException
 
96
     */
 
97
    public function getByName($name)
 
98
    {
 
99
        $client = $this->query(null, ['name' => $name]);
 
100
 
 
101
        if (count($client) <= 0)
 
102
            throw new NotFoundException();
 
103
 
 
104
        return $client[0];
 
105
    }
 
106
 
 
107
    /**
92
108
     * @param int $userId
93
109
     * @return array
94
110
     */
139
155
            $params['clientId'] = $this->getSanitizer()->getString('clientId', $filterBy);
140
156
        }
141
157
 
 
158
        if ($this->getSanitizer()->getString('name', $filterBy) != null) {
 
159
            $body .= ' AND `oauth_clients`.name = :name';
 
160
            $params['name'] = $this->getSanitizer()->getString('name', $filterBy);
 
161
        }
 
162
 
142
163
        // Sorting?
143
164
        $order = '';
144
165
        if (is_array($sortOrder))