From 1a9d06b4700f1af7dafa2f08293ff5cbd73862d0 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Thu, 31 Mar 2011 13:36:46 +1300 Subject: [PATCH] Move functions to somewhere that it's reasonable to define them! Signed-off-by: Andrew McMillan --- inc/Principal.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/inc/Principal.php b/inc/Principal.php index 8384dce5..c0b29117 100644 --- a/inc/Principal.php +++ b/inc/Principal.php @@ -97,6 +97,7 @@ class Principal { private $cacheNs; private $cacheKey; + function __construct( $type, $value, $use_cache=true ) { 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(); if ( $use_cache && isset($session->principal_id) ) { 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() { $this->user_no = -1; $this->exists = false;