function GetTemplate() { global $dbh; $this->MakeSafe(); $sql = "SELECT * FROM fac_CDUTemplate WHERE TemplateID={$this->TemplateID}"; if ($row = $dbh->query($sql)->fetch()) { foreach (CDUTemplate::RowToObject($row) as $prop => $value) { $this->{$prop} = $value; } return true; } else { return false; } }