public function getIconFile(\ElggEntity $entity, $size = '') {

		$dir = $this->getIconDirectory($entity, $size);
		$filename = $this->getIconFilename($entity, $size);

		if ($entity instanceof \ElggUser) {
			$owner_guid = $entity->guid;
		} else if ($entity->owner_guid) {
			$owner_guid = $entity->owner_guid;
		} else {
			$owner_guid = elgg_get_site_entity();
		}
		
		$file = new \ElggFile();
		$file->owner_guid = $owner_guid;
		$file->setFilename("{$dir}/{$filename}");
		$file->mimetype = $file->detectMimeType();

		return $file;
	}
public function getIconFile(\ElggEntity $entity, $size = '') {

		$dir = $this->getIconDirectory($entity, $size);
		$filename = $this->getIconFilename($entity, $size);

		if ($entity instanceof \ElggUser) {
			$owner_guid = $entity->guid;
		} else if ($entity->owner_guid) {
			$owner_guid = $entity->owner_guid;
		} else {
			$owner_guid = elgg_get_site_entity();
		}
		
		$file = new \ElggFile();
		$file->owner_guid = $owner_guid;
		$file->setFilename("{$dir}/{$filename}");
		$file->mimetype = $file->detectMimeType();

		return $file;
	}
public function getIconFile ( \ ElggEntity $ entity , $ size = '' ) { $ dir = $ this -> getIconDirectory ( $ entity , $ size ) ; $ filename = $ this -> getIconFilename ( $ entity , $ size ) ; if ( $ entity instanceof \ ElggUser ) { $ owner_guid = $ entity -> guid ; } else if ( $ entity -> owner_guid ) { $ owner_guid = $ entity -> owner_guid ; } else { $ owner_guid = elgg_get_site_entity ( ) ; } $ file = new \ ElggFile ( ) ; $ file -> owner_guid = $ owner_guid ; $ file -> setFilename ( "{$dir}/{$filename}" ) ; $ file -> mimetype = $ file -> detectMimeType ( ) ; return $ file ; }
Returns an ElggFile containing the entity icon

@param \ElggEntity $entity Entity
@param string      $size   Size
@return \ElggFile
Returns an ElggFile containing the entity icon