-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCollectionRoleRepository.php
More file actions
66 lines (60 loc) · 2.41 KB
/
Copy pathCollectionRoleRepository.php
File metadata and controls
66 lines (60 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* This file is part of OPUS. The software OPUS has been originally developed
* at the University of Stuttgart with funding from the German Research Net,
* the Federal Department of Higher Education and Research and the Ministry
* of Science, Research and the Arts of the State of Baden-Wuerttemberg.
*
* OPUS 4 is a complete rewrite of the original OPUS software and was developed
* by the Stuttgart University Library, the Library Service Center
* Baden-Wuerttemberg, the Cooperative Library Network Berlin-Brandenburg,
* the Saarland University and State Library, the Saxon State Library -
* Dresden State and University Library, the Bielefeld University Library and
* the University Library of Hamburg University of Technology with funding from
* the German Research Foundation and the European Regional Development Fund.
*
* LICENCE
* OPUS is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the Licence, or any later version.
* OPUS is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. You should have received a copy of the GNU General Public License
* along with OPUS; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright Copyright (c) 2021, OPUS 4 development team
* @license http://www.gnu.org/licenses/gpl.html General Public License
*/
namespace Opus\Db2;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\ORMException;
use Opus\Model2\CollectionRole;
class CollectionRoleRepository extends EntityRepository
{
/**
* Retrieve all CollectionRole instances from the database.
*
* @return CollectionRole[]
* @throws ORMException
*/
public function getAll()
{
return $this->findAll();
}
/**
* Retrieves an existing CollectionRole instance by name. Returns
* null if name is null *or* if nothing was found.
*
* @param string|null $name
* @return CollectionRole|null
*/
public function fetchByName($name = null)
{
if ($name === null) {
return null;
}
return $this->findOneBy(['name' => $name]);
}
}