本文整理汇总了PHP中SugarBean::get_summary_text方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarBean::get_summary_text方法的具体用法?PHP SugarBean::get_summary_text怎么用?PHP SugarBean::get_summary_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarBean
的用法示例。
在下文中一共展示了SugarBean::get_summary_text方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trackView
/**
* Track a view for a particular bean.
*
* @param SugarBean $seed
* @param string $current_view
*/
function trackView($seed, $current_view)
{
$trackerManager = TrackerManager::getInstance();
if ($monitor = $trackerManager->getMonitor('tracker')) {
$monitor->setValue('date_modified', TimeDate::getInstance()->nowDb());
$monitor->setValue('user_id', $GLOBALS['current_user']->id);
$monitor->setValue('module_name', $seed->module_dir);
$monitor->setValue('action', $current_view);
$monitor->setValue('item_id', $seed->id);
$monitor->setValue('item_summary', $seed->get_summary_text());
$monitor->setValue('visible', true);
$trackerManager->saveMonitor($monitor, TRUE, TRUE);
}
}
示例2: _getModuleTitleParams
/**
* Returns an array composing of the breadcrumbs to use for the module title
*
* @param bool $browserTitle true if the returned string is being used for the browser title, meaning
* there should be no HTML in the string
*
* @return array
*/
protected function _getModuleTitleParams($browserTitle = false)
{
$params = [$this->_getModuleTitleListParam($browserTitle)];
if (isset($this->action)) {
switch ($this->action) {
case 'EditView':
if (!empty($this->bean->id) && (empty($_REQUEST['isDuplicate']) || $_REQUEST['isDuplicate'] === 'false')) {
$params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>" . $this->bean->get_summary_text() . "</a>";
$params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL'];
} else {
$params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL'];
}
break;
case 'DetailView':
$beanName = $this->bean->get_summary_text();
$params[] = $beanName;
break;
}
}
return $params;
}
示例3: trackAction
/**
* Adds an entry in the tracker table noting that this record was touched
*
* @param SugarBean $bean The bean to record in the tracker table
*/
public function trackAction(SugarBean $bean)
{
$manager = $this->getTrackerManager();
$monitor = $manager->getMonitor('tracker');
if (!$monitor) {
// This tracker is disabled.
return;
}
if (empty($bean->id) || isset($bean->new_with_id) && $bean->new_with_id) {
// It's a new bean, don't record it.
// Tracking bean saves/creates happens in the SugarBean so it is always recorded
return;
}
$monitor->setValue('team_id', $this->api->user->getPrivateTeamID());
$monitor->setValue('action', $this->action);
$monitor->setValue('user_id', $this->api->user->id);
$monitor->setValue('module_name', $bean->module_dir);
$monitor->setValue('date_modified', TimeDate::getInstance()->nowDb());
$monitor->setValue('visible', 1);
$monitor->setValue('item_id', $bean->id);
$monitor->setValue('item_summary', $bean->get_summary_text());
$manager->saveMonitor($monitor, true, true);
}
示例4: getRecordSummary
function getRecordSummary(SugarBean $bean)
{
global $listViewDefs;
if (!isset($listViewDefs) || !isset($listViewDefs[$bean->module_dir])) {
if (file_exists('custom/modules/' . $bean->module_dir . '/metadata/listviewdefs.php')) {
require 'custom/modules/' . $bean->module_dir . '/metadata/listviewdefs.php';
} else {
if (file_exists('modules/' . $bean->module_dir . '/metadata/listviewdefs.php')) {
require 'modules/' . $bean->module_dir . '/metadata/listviewdefs.php';
}
}
}
if (!isset($listViewDefs) || !isset($listViewDefs[$bean->module_dir])) {
return $bean->get_summary_text();
}
$summary = array();
foreach ($listViewDefs[$bean->module_dir] as $key => $entry) {
if (!$entry['default']) {
continue;
}
$key = strtolower($key);
if (in_array($key, array('date_entered', 'date_modified', 'name'))) {
continue;
}
$summary[] = $bean->{$key};
}
$summary = array_filter($summary);
return implode(' || ', $summary);
}
示例5: getBeanAttributes
/**
* Helper to denormalize critical bean attributes.
*
* @param SugarBean $bean
*
* @return array Contains name, type, module and ID of the bean.
*/
public static function getBeanAttributes(SugarBean $bean)
{
return array('name' => $bean->get_summary_text(), 'type' => $bean->object_name, 'module' => $bean->module_name, 'id' => $bean->id);
}
示例6: getSummaryText
public function getSummaryText()
{
if ($this->bean !== FALSE) {
return $this->bean->get_summary_text();
}
}