本文整理匯總了PHP中ElggEntity::getIconURL方法的典型用法代碼示例。如果您正苦於以下問題:PHP ElggEntity::getIconURL方法的具體用法?PHP ElggEntity::getIconURL怎麽用?PHP ElggEntity::getIconURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ElggEntity
的用法示例。
在下文中一共展示了ElggEntity::getIconURL方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRowCells
/**
* Map column headers to a proper representation in the row cell
* @param ElggEntity $entity
* @param boolean $csv
* @return array
*/
public function getRowCells($entity)
{
$row = array();
$headers = $this->getColumnHeaders();
foreach ($headers as $header => $label) {
$value = '';
switch ($header) {
default:
$value = $entity->{$header};
if (is_array($value)) {
$value = implode('; ', $value);
}
break;
case 'guid':
$value = $entity->guid;
break;
case 'icon':
$value = $entity->getIconURL();
if (!elgg_in_context('plaintext')) {
$value = elgg_view_entity_icon($entity, 'small');
}
break;
case 'title':
$value = elgg_instanceof($entity, 'object') ? $entity->title : $entity->name;
if (!elgg_in_context('plaintext')) {
$value = elgg_view('output/url', array('text' => $value, 'href' => $entity->getURL()));
}
break;
case 'time_created':
$value = date('M d, Y H:i', $entity->time_created);
break;
case 'owner_guid':
$value = '';
$owner = $entity->getOwnerEntity();
if (elgg_instanceof($owner)) {
$value = $owner->guid;
if (!elgg_in_context('plaintext')) {
$value = elgg_view('output/url', array('text' => elgg_instanceof($owner, 'object') ? $owner->title : $owner->name, 'href' => $owner->getURL()));
}
}
break;
case 'container_guid':
$value = '';
$container = $entity->getContainerEntity();
if (elgg_instanceof($container)) {
$value = $container->guid;
if (!elgg_in_context('plaintext')) {
$value = elgg_view('output/url', array('text' => elgg_instanceof($container, 'object') ? $container->title : $container->name, 'href' => $container->getURL()));
}
}
break;
}
$row[$header] = $value;
}
return elgg_trigger_plugin_hook('export:entity', 'table', array('headers' => $this->getColumnHeaders(), 'entity' => $entity), $row);
}