Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
ab04aec4
Commit
ab04aec4
authored
Jan 06, 2016
by
Laurent Lécluse
Browse files
Refactoring
parent
3a328aee
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Service/Traits/CategoriePrivilegeAwareTrait.php
deleted
100644 → 0
View file @
3a328aee
<?php
namespace
UnicaenAuth\Service\Traits
;
use
UnicaenAuth\Service\CategoriePrivilegeService
;
use
RuntimeException
;
/**
* Description of CategoriePrivilegeServiceAwareTrait
*
* @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
*/
trait
CategoriePrivilegeServiceAwareTrait
{
/**
* @var CategoriePrivilegeService
*/
private
$serviceCategoriePrivilege
;
/**
* @param CategoriePrivilegeService $serviceCategoriePrivilege
*
* @return self
*/
public
function
setServiceCategoriePrivilege
(
CategoriePrivilegeService
$serviceCategoriePrivilege
)
{
$this
->
serviceCategoriePrivilege
=
$serviceCategoriePrivilege
;
return
$this
;
}
/**
* @return CategoriePrivilegeService
* @throws RuntimeException
*/
public
function
getServiceCategoriePrivilege
()
{
if
(
empty
(
$this
->
serviceCategoriePrivilege
))
{
if
(
!
method_exists
(
$this
,
'getServiceLocator'
))
{
throw
new
RuntimeException
(
'La classe '
.
get_class
(
$this
)
.
' n\'a pas accès au ServiceLocator.'
);
}
$serviceLocator
=
$this
->
getServiceLocator
();
if
(
method_exists
(
$serviceLocator
,
'getServiceLocator'
))
{
$serviceLocator
=
$serviceLocator
->
getServiceLocator
();
}
$this
->
serviceCategoriePrivilege
=
$serviceLocator
->
get
(
'UnicaenAuth\Service\CategoriePrivilege'
);
}
return
$this
->
serviceCategoriePrivilege
;
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment