本文整理汇总了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);
}