/** * get custom fields * * @return objects array */ function getCustomfields() { $query = ' SELECT f.* ' . ' FROM #__redevent_fields AS f ' . ' WHERE f.object_key = ' . $this->_db->Quote("redevent.event") . ' ORDER BY f.ordering '; $this->_db->setQuery($query); $result = $this->_db->loadObjectList(); if (!$result) { return array(); } $fields = array(); $data = $this->getData(); foreach ($result as $c) { $field =& redEVENTHelper::getCustomField($c->type); $field->bind($c); $prop = 'custom' . $c->id; if (isset($data->{$prop})) { $field->value = $data->{$prop}; } $fields[] = $field; } return $fields; }