Move functions to somewhere that it's reasonable to define them!

Signed-off-by: Andrew McMillan <andrew@morphoss.com>
This commit is contained in:
Andrew McMillan 2011-03-31 13:36:46 +13:00
parent db079408d7
commit 1a9d06b470

View File

@ -97,6 +97,7 @@ class Principal {
private $cacheNs; private $cacheNs;
private $cacheKey; private $cacheKey;
function __construct( $type, $value, $use_cache=true ) { function __construct( $type, $value, $use_cache=true ) {
global $c, $session; global $c, $session;
@ -115,26 +116,6 @@ class Principal {
} }
/**
* This will allow protected properties to be referenced for retrieval, but not
* referenced for update.
* @param $property
*/
function __get( $property ) {
return $this->{$property};
}
/**
* This will allow protected properties to be examined for whether they are set
* without making them writable. PHP 5.1 or later only.
* @param $property
*/
function __isset( $property ) {
return isset($this->{$property});
}
$cache = new AwlCache(); $cache = new AwlCache();
if ( $use_cache && isset($session->principal_id) ) { if ( $use_cache && isset($session->principal_id) ) {
switch ( $type ) { switch ( $type ) {
@ -235,6 +216,25 @@ class Principal {
} }
} }
/**
* This will allow protected properties to be referenced for retrieval, but not
* referenced for update.
* @param $property
*/
public function __get( $property ) {
return $this->{$property};
}
/**
* This will allow protected properties to be examined for whether they are set
* without making them writable. PHP 5.1 or later only.
* @param $property
*/
public function __isset( $property ) {
return isset($this->{$property});
}
private function assignGuestValues() { private function assignGuestValues() {
$this->user_no = -1; $this->user_no = -1;
$this->exists = false; $this->exists = false;