Created
January 15, 2010 18:18
-
-
Save tjboudreaux/278282 to your computer and use it in GitHub Desktop.
This file contains 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
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