/** * retrieve array of {@link icms_view_template_set_Object}s meeting certain conditions * @param object $criteria {@link icms_db_criteria_Element} with conditions for the blocks * @param bool $id_as_key should the tplfile's tpl_id be the key for the returned array? * @return array {@link icms_view_template_set_Object}s matching the conditions **/ public function getObjects($criteria = null, $id_as_key = false) { $ret = array(); $limit = $start = 0; $sql = 'SELECT * FROM ' . $this->db->prefix('tplset'); if (isset($criteria) && is_subclass_of($criteria, 'icms_db_criteria_Element')) { $sql .= ' ' . $criteria->renderWhere() . ' ORDER BY tplset_id'; $limit = $criteria->getLimit(); $start = $criteria->getStart(); } $result = $this->db->query($sql, $limit, $start); if (!$result) { return $ret; } while ($myrow = $this->db->fetchArray($result)) { $tplset = new icms_view_template_set_Object(); $tplset->assignVars($myrow); if (!$id_as_key) { $ret[] =& $tplset; } else { $ret[$myrow['tplset_id']] =& $tplset; } unset($tplset); } return $ret; }
/** * constructor */ function XoopsTplset() { parent::__construct(); $this->_deprecated = icms_core_Debug::setDeprecated('icms_view_template_set_Object', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); }