|
Revision 3782, 0.9 KB
(checked in by wjohnald, 2 years ago)
|
|
refactored categories filter to be saved in the session. Added a wrapper to aPeopleTools for setting and getting user attributes.
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | /** |
|---|
| 4 | * @package apostrophePeoplePlugin |
|---|
| 5 | * @subpackage toolkit |
|---|
| 6 | * @author P'unk Avenue <apostrophe.punkave.com> |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | class BaseaPeopleTools |
|---|
| 10 | { |
|---|
| 11 | |
|---|
| 12 | /** |
|---|
| 13 | * DOCUMENT ME |
|---|
| 14 | * @return mixed |
|---|
| 15 | */ |
|---|
| 16 | static protected function getUser() |
|---|
| 17 | { |
|---|
| 18 | return sfContext::getInstance()->getUser(); |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | /** |
|---|
| 22 | * DOCUMENT ME |
|---|
| 23 | * @param mixed $attribute |
|---|
| 24 | * @param mixed $default |
|---|
| 25 | * @return mixed |
|---|
| 26 | */ |
|---|
| 27 | static public function getAttribute($attribute, $default = null) |
|---|
| 28 | { |
|---|
| 29 | $attribute = "aPeople-$attribute"; |
|---|
| 30 | return aPeopleTools::getUser()->getAttribute($attribute, $default, 'apostrophe'); |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | /** |
|---|
| 34 | * DOCUMENT ME |
|---|
| 35 | * @param mixed $attribute |
|---|
| 36 | * @param mixed $value |
|---|
| 37 | */ |
|---|
| 38 | static public function setAttribute($attribute, $value = null) |
|---|
| 39 | { |
|---|
| 40 | $attribute = "aPeople-$attribute"; |
|---|
| 41 | aPeopleTools::getUser()->setAttribute($attribute, $value, 'apostrophe'); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | } |
|---|