/** * Method to get a single comment. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { $item->content_id = (string) $item->content_id . ' - ' . $this->_getContentTitle($item->id); } return $item; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.0.0 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { $item->products = $this->getPromoProducts($item->id); } return $item; }
/** * Method to get a single record. * * @param integer The id of the primary key. * * @return mixed Object on success, false on failure. * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { //Do any procesing on fields here if needed } return $item; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { if (!empty($item->params)) { // Convert the params field to an array. $registry = new Registry(); $registry->loadString($item->params); $item->params = $registry->toArray(); } if (!empty($item->metadata)) { // Convert the metadata field to an array. $registry = new Registry(); $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } if (!empty($item->interventions)) { // JSON Decode interventions. $item->interventions = json_decode($item->interventions); } if (!empty($item->id)) { $item->tags = new JHelperTags(); $item->tags->getTagIds($item->id, 'com_costbenefitprojection.intervention'); } } return $item; }
public function getItem($pk = null) { if ($item = parent::getItem($pk)) { $item->assistance = $item->params['assistance']; } return $item; }
/** * Method to get a single record. * * @param integer The id of the primary key. * * @return mixed Object on success, false on failure. */ public function getItem($pk = null) { //debug::msg('model->getItem'); if ($item = parent::getItem($pk)) { // Convert the params field to an array. /* $registry = new JRegistry; $registry->loadString($item->attribs); $item->attribs = $registry->toArray(); // Convert the metadata field to an array. $registry = new JRegistry; $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); // Convert the images field to an array. $registry = new JRegistry; $registry->loadString($item->images); $item->images = $registry->toArray(); // Convert the urls field to an array. $registry = new JRegistry; $registry->loadString($item->urls); $item->urls = $registry->toArray(); $item->articletext = trim($item->fulltext) != '' ? $item->introtext . "<hr id=\"system-readmore\" />" . $item->fulltext : $item->introtext; * */ } return $item; }
/** * Method to get a single record. * * @param integer The id of the primary key. * * @return mixed Object on success, false on failure. */ public function getItem($pk = null) { $item = parent::getItem($pk); if ($item == false) { return false; } if (property_exists($item, 'attribs')) { // Convert the params field to an array. $registry = new JRegistry(); $registry->loadString($item->attribs); $item->params = $registry; $item->attribs = $registry->toArray(); } if ($item->id > 0) { // Existing record $labels = $this->getInstance('Labels', 'PFModel'); $item->labels = $labels->getConnections('com_pfrepo.directory', $item->id); $item->orphaned = $this->isOrphaned($item->project_id); $item->element_count = 0; } else { // New record $item->labels = array(); $item->orphaned = false; $item->element_count = $this->getElementCount($pk); } return $item; }
public function getItem($pk = null) { if ($item = parent::getItem($pk)) { $registry = new JRegistry(); $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } // Load associated contact items $app = JFactory::getApplication(); $assoc = JLanguageAssociations::isEnabled(); if ($assoc) { $item->associations = array(); if ($item->id != null) { $associations = JLanguageAssociations::getAssociations('com_authorlist', '#__authorlist', 'com_authorlist.author', $item->id, 'id', '', ''); foreach ($associations as $tag => $association) { $item->associations[$tag] = $association->id; } } } // Load item tags if (!empty($item->id)) { $item->tags = new JHelperTags(); $item->tags->getTagIds($item->id, 'com_authorlist.author'); } return $item; }
/** * Method to get a single record. * * @param integer The id of the primary key. * * @return mixed Object on success, false on failure. */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { // TODO? } return $item; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.6 */ public function getItem($pk = null) { $result = parent::getItem($pk); // Trigger the data preparation event. $results = Event::trigger('user.onContentPrepareData', array('com_users.user', $result)); return $result; }
public function getItem($pk = null) { $item = parent::getItem($pk); $item->selections = new Registry($item->selections); $item->selections = $item->selections->toArray(); return $item; }
/** * Method to get a category. * * @param integer An optional id of the object to get, otherwise the id from the model state is used. * @return mixed Category data object on success, false on failure. * @since 1.6 */ public function getItem($pk = null) { if ($result = parent::getItem($pk)) { // Prime required properties. if (empty($result->id)) { $result->parent_id = $this->getState('category.parent_id'); $result->extension = $this->getState('category.extension'); } // Convert the metadata field to an array. $registry = new JRegistry(); $registry->loadJSON($result->metadata); $result->metadata = $registry->toArray(); // Convert the created and modified dates to local user time for display in the form. jimport('joomla.utilities.date'); $tz = new DateTimeZone(JFactory::getApplication()->getCfg('offset')); if (intval($result->created_time)) { $date = new JDate($result->created_time); $date->setTimezone($tz); $result->created_time = $date->toMySQL(true); } else { $result->created_time = null; } if (intval($result->modified_time)) { $date = new JDate($result->modified_time); $date->setTimezone($tz); $result->modified_time = $date->toMySQL(true); } else { $result->modified_time = null; } } return $result; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { if (!empty($item->params)) { // Convert the params field to an array. $registry = new Registry(); $registry->loadString($item->params); $item->params = $registry->toArray(); } if (!empty($item->metadata)) { // Convert the metadata field to an array. $registry = new Registry(); $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } if (!empty($item->groups)) { // JSON Decode groups. $item->groups = json_decode($item->groups, true); } if (!empty($item->id)) { $item->tags = new JHelperTags(); $item->tags->getTagIds($item->id, 'com_componentbuilder.help_document'); } } return $item; }
public function getItem($pk = null) { if ($item = parent::getItem($pk)) { // Convert the params field to an array. } return $item; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { if (!empty($item->params)) { // Convert the params field to an array. $registry = new Registry(); $registry->loadString($item->params); $item->params = $registry->toArray(); } if (!empty($item->metadata)) { // Convert the metadata field to an array. $registry = new Registry(); $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } if (!empty($item->testcompanies)) { // JSON Decode testcompanies. $item->testcompanies = json_decode($item->testcompanies); } if (!empty($item->id)) { $item->tags = new JHelperTags(); $item->tags->getTagIds($item->id, 'com_costbenefitprojection.service_provider'); } } $this->service_providervvvx = $item->id; return $item; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { if (!empty($item->params)) { // Convert the params field to an array. $registry = new Registry(); $registry->loadString($item->params); $item->params = $registry->toArray(); } if (!empty($item->metadata)) { // Convert the metadata field to an array. $registry = new Registry(); $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } if (!empty($item->causesrisks)) { // JSON Decode causesrisks. $item->causesrisks = json_decode($item->causesrisks); } if (!empty($item->id)) { $item->tags = new JHelperTags(); $item->tags->getTagIds($item->id, 'com_costbenefitprojection.country'); } } $this->countryvvvy = $item->id; $this->countryvvvz = $item->id; $this->countryvvwa = $item->id; return $item; }
/** * Method to get a record * @return object with data */ public function getItem($pk = null) { if (empty($pk)) { $cid = JRequest::getVar('cid', array(0), null, 'array'); $pk = $cid[0]; } if (empty($pk)) { $pk = JRequest::getInt('product_id'); } if ($item = parent::getItem($pk)) { $today = JFactory::getDate(); if (empty($pk)) { $item->tag_name1 = JText::_('COM_CP_TAG1_DESC'); $item->tag_name2 = JText::_('COM_CP_TAG2_DESC'); $item->tag_name3 = JText::_('COM_CP_TAG3_DESC'); $item->tag_name4 = JText::_('COM_CP_TAG4_DESC'); $item->tag_name5 = JText::_('COM_CP_TAG5_DESC'); $item->tag_name6 = JText::_('COM_CP_TAG6_DESC'); $item->publish_up = date('Y-m-d'); } $item->publish_up = substr($item->publish_up, 0, 10); $item->publish_down = substr($item->publish_down, 0, 10); $query = 'SELECT * FROM `#__cp_product_files` WHERE `product_id` = ' . $pk . ' ORDER BY `ordering` ASC'; $this->_db->setQuery($query); $item->media = $this->_db->loadObjectList(); $query = 'SELECT tourismtype_id FROM `#__cp_product_tourismtype` WHERE `product_id` = ' . $pk; $this->_db->setQuery($query); $item->tourismtype_id = $this->_db->loadColumn(); } return $item; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { if (!empty($item->params)) { // Convert the params field to an array. $registry = new Registry(); $registry->loadString($item->params); $item->params = $registry->toArray(); } if (!empty($item->metadata)) { // Convert the metadata field to an array. $registry = new Registry(); $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } if (!empty($item->template)) { // base64 Decode template. $item->template = base64_decode($item->template); } if (!empty($item->php_view)) { // base64 Decode php_view. $item->php_view = base64_decode($item->php_view); } if (!empty($item->id)) { $item->tags = new JHelperTags(); $item->tags->getTagIds($item->id, 'com_componentbuilder.template'); } } return $item; }
/** * Method to get a single record. * * @param integer The id of the primary key. * * @return mixed Object on success, false on failure. */ public function getItem($pk = null) { //debug::msg('model->getItem'); if ($item = parent::getItem($pk)) { } return $item; }
public function getItem($pk = null) { $item = parent::getItem($pk); if ($item->meal) { $item->meal = explode(';', $item->meal); } return $item; }
/** * Method to get a single record. * * @param integer The id of the primary key. * * @return mixed Object on success, false on failure. * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { $courses = explode(',', $item->courses); $item->courses = $courses; } return $item; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. */ public function getItem($pk = null) { $item = parent::getItem($pk); $app = JFactory::getApplication(''); $item->map = $app->input->getInt('map'); $item->listordering = $item->id; return $item; }
public function getItem($pk = null) { $db = JFactory::getDBO(); $query = $db->getQuery(true); $item = parent::getItem(); $query->select('*')->from($db->qn('#__rsmembership_extra_value_shared'))->where($db->qn('extra_value_id') . ' = ' . $db->q($item->id))->order($db->qn('ordering') . ' ASC'); $db->setQuery($query); $item->shared = $db->loadObjectList(); foreach ($item->shared as $s => $shared) { switch ($shared->type) { default: $instances = RSMembership::getSharedContentPlugins(); foreach ($instances as $instance) { if (method_exists($instance, 'showUserFriendlyParams')) { $instance->showUserFriendlyParams($shared); } } $item->shared[$s] = $shared; break; case 'article': $query->clear(); $query->select($db->qn('title'))->from($db->qn('#__content'))->where($db->qn('id') . ' = ' . $db->q((int) $shared->params)); $db->setQuery($query); $item->shared[$s]->params = $db->loadResult(); break; case 'module': $query->clear(); $query->select($db->qn('title') . ', ' . $db->qn('module'))->from($db->qn('#__modules'))->where($db->qn('id') . ' = ' . $db->q((int) $shared->params)); $db->setQuery($query); $module = $db->loadObject(); $item->shared[$s]->params = '(' . $module->module . ') ' . $module->title; break; case 'menu': $query->clear(); $query->select($db->qn('title', 'name') . ', ' . $db->qn('menutype'))->from($db->qn('#__menu'))->where($db->qn('id') . ' = ' . $db->q((int) $shared->params)); $db->setQuery($query); $menu = $db->loadObject(); $item->shared[$s]->params = '(' . $menu->menutype . ') ' . $menu->name; break; case 'section': $query->clear(); $query->select($db->qn('title'))->from($db->qn('#__sections'))->where($db->qn('id') . ' = ' . $db->q((int) $shared->params)); $db->setQuery($query); $item->shared[$s]->params = $db->loadResult(); break; case 'category': $query->clear(); $query->select($db->qn('title'))->from($db->qn('#__categories'))->where($db->qn('id') . ' = ' . $db->q((int) $shared->params)); $db->setQuery($query); $item->shared[$s]->params = $db->loadResult(); break; } } jimport('joomla.html.pagination'); $item->sharedPagination = new JPagination(count($item->shared), 0, 0); return $item; }
public function getItem($pk = null) { if ($item = parent::getItem($pk)) { $item->field = null; $item->groupid = TZ_Portfolio_PlusHelperExtraFields::getFieldGroups((int) $item->id); return $item; } return false; }
public function getItem($pk = null) { $item = parent::getItem($pk); if ($item->id) { $registry = new JRegistry(); $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } return $item; }
/** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 2.5 */ public function getItem($pk = null) { $result = parent::getItem($pk); // Get the dispatcher and load the users plugins. $dispatcher = JDispatcher::getInstance(); JPluginHelper::importPlugin('user'); // Trigger the data preparation event. $results = $dispatcher->trigger('onContentPrepareData', array('com_users.note', $result)); return $result; }
public function getItem($pk = null) { $item = parent::getItem($pk); $data = $item->params; if ($item) { $item->type = isset($item->params['type']) ? $item->params['type'] : null; $item->unit = isset($item->params['unit']) ? $item->params['unit'] : null; } return $item; }
/** * Method to get a single record. * * @param integer The id of the primary key. * * @return mixed Object on success, false on failure. * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { // Set Joomla component for new mappings if (!$item->joomla_app) { $item->joomla_app = 'joomla16'; } } return $item; }
/** * Method to get a single record. * * @param integer The id of the primary key. * * @return mixed Object on success, false on failure. */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { // Convert the params field to an array. $registry = new JRegistry(); $registry->loadString($item->attribs); $item->attribs = $registry->toArray(); } return $item; }
public function getItem($pk = null) { $item = parent::getItem($pk = null); $membership = $this->getInstance('Membership', 'RSMembershipModel'); $membership_from = $membership->getItem($item->membership_from_id); $membership_to = $membership->getItem($item->membership_to_id); $item->name_from = $membership_from->name; $item->name_to = $membership_to->name; return $item; }