Skip to content

Instantly share code, notes, and snippets.

@tjboudreaux
Created January 15, 2010 18:18
Show Gist options
  • Save tjboudreaux/278282 to your computer and use it in GitHub Desktop.
Save tjboudreaux/278282 to your computer and use it in GitHub Desktop.
class User_Model_User extends User_Model_Base_User
{
const IS_ACTIVE_OFF = 0;
const IS_ACTIVE_ON = 1;
public static $isActiveFlag = self::IS_ACTIVE_OFF;
public function hook()
{
if (self::$isActiveFlag)
{
//filter here
}
}
}
class UserController
{
public function indexAction()
{
User_Model_User::$isActiveFlag = User_Model_User::IS_ACTIVE_ON;
$active_users = $this->_User->findAll();
User_Model_User::$isActiveFlag = User_Model_User::IS_ACTIVE_OFF;
$inactive_users = $this->_User->findAll();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment