本文整理汇总了PHP中JModelAdmin::getItem方法的典型用法代码示例。如果您正苦于以下问题:PHP JModelAdmin::getItem方法的具体用法?PHP JModelAdmin::getItem怎么用?PHP JModelAdmin::getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JModelAdmin
的用法示例。
在下文中一共展示了JModelAdmin::getItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItem
/**
* 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;
}
示例2: getItem
/**
* 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;
}
示例3: getItem
/**
* 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;
}
示例4: getItem
/**
* 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;
}
示例5: getItem
public function getItem($pk = null)
{
if ($item = parent::getItem($pk)) {
$item->assistance = $item->params['assistance'];
}
return $item;
}
示例6: getItem
/**
* 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;
}
示例7: getItem
/**
* 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;
}
示例8: getItem
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;
}
示例9: getItem
/**
* 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;
}
示例10: getItem
/**
* 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;
}
示例11: getItem
public function getItem($pk = null)
{
$item = parent::getItem($pk);
$item->selections = new Registry($item->selections);
$item->selections = $item->selections->toArray();
return $item;
}
示例12: getItem
/**
* 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;
}
示例13: getItem
/**
* 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;
}
示例14: getItem
public function getItem($pk = null)
{
if ($item = parent::getItem($pk)) {
// Convert the params field to an array.
}
return $item;
}
示例15: getItem
/**
* 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;
}