/** * Retrieved list of objects base on a given parameters - dynamic method: list_UserContact() * * * Generated with the DalClassGenerator created by: * Zoran Hron <*****@*****.**> * * @param conditionalStatement = null * @param orderby = null * @param sort = null * @param limit = 0 * @param fetchmode = DB_FETCHMODE_OBJECT * @result array of objects: UserContact **/ public function list_UserContact($conditionalStatement = null, $orderby = null, $sort = null, $limit = 0, $fetchmode = DB_FETCHMODE_OBJECT) { // build MySQL query $sql = "SELECT * FROM { user_contact } "; if ($conditionalStatement) { $sql .= "WHERE {$conditionalStatement}"; } if ($orderby) { $sql .= " ORDER BY {$orderby}"; } if ($sort) { $sql .= " {$sort}"; } if ($limit) { $sql .= " LIMIT {$limit}"; } $sql .= ";"; // execute query $res = Dal::query($sql); $objects = array(); // data found? if ($res->numRows() > 0) { // retrieve data objects while ($row = $res->fetchRow($fetchmode)) { if ($fetchmode == DB_FETCHMODE_OBJECT) { $obj = new UserContact(); $obj->populateFromObject($row); $objects[] = $obj; } else { $objects[] = $row; } } } return $objects; }