Skip to content

Instantly share code, notes, and snippets.

@gpfiel
Last active August 29, 2015 13:56
Show Gist options
  • Save gpfiel/8847889 to your computer and use it in GitHub Desktop.
Save gpfiel/8847889 to your computer and use it in GitHub Desktop.
<?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