dbobject constructor

34 views
Skip to first unread message

Simas

unread,
Oct 15, 2011, 7:47:54 AM10/15/11
to Simple PHP Framework
Hi, how to get value from DB ($this->columnname..) in constructor
(dboject class) ?

public function __construct($id = null)
{
parent::__construct('klientai', array('id', 'owner',
'address', 'phone', 'squares'), $id);
$this->t = getdate();
$this->Generate($this->squares); // <<----------- $this-
>squares passes empty!! Why!?
}


If I call like this, everything is ok:

public function Get_Mokestis(){
return this->squares; <-- works
}

Here is main call:

$klientai = DBObject::glob('Apskaita', "SELECT * FROM klientai LIMIT
{$pager->firstRecord}, {$pager->perPage}");

Reply all
Reply to author
Forward
0 new messages