From f3370db7c9450501a4d2df3779064befd6ef9fef Mon Sep 17 00:00:00 2001 From: Vincent Zanotti Date: Sun, 15 Jun 2008 18:26:36 +0200 Subject: [PATCH] Allows the PlUser class to be instantiated lazily (prevents useless SQL queries). Signed-off-by: Vincent Zanotti --- classes/pluser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/pluser.php b/classes/pluser.php index f18bac1..070d289 100644 --- a/classes/pluser.php +++ b/classes/pluser.php @@ -52,8 +52,10 @@ abstract class PlUser // redirection) and an optionnal array of known user properties. public function __construct($login, $values = array()) { - list($this->user_id, $this->hruid) = $this->getLogin($login); $this->fillFromArray($values); + if (!isset($this->user_id) || !isset($this->hruid)) { + list($this->user_id, $this->hruid) = $this->getLogin($login); + } } -- 2.1.4