Last active
August 29, 2015 13:56
-
-
Save gpfiel/8847889 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* [getParam search for a global param in the session example Pagination. 30 by default or 50 by user specific] | |
* @param [type] $param [Param name example Pagination] | |
* @return [type] [return param if exists or false] | |
*/ | |
public function getParam($param) | |
{ | |
$auth = new AuthenticationService(); | |
$default = null; | |
foreach ($auth->getIdentity()->params as $paramTmp) { | |
if ($param == $paramTmp->getName() and is_null($paramTmp->getUser())) { | |
$default = $paramTmp; | |
} | |
if ($param == $paramTmp->getName() and !is_null($paramTmp->getUser())) { | |
return $paramTmp; | |
} | |
} | |
return (is_null($default) ? false : $default); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment