public function getIconDirectory(\ElggEntity $entity, $size = null, $directory = null) {

		$sizes = $this->getSizes($entity);
		if (isset($sizes[$size]['metadata_name'])) {
			$md_name = $sizes[$size]['metadata_name'];
			if ($entity->$md_name) {
				$directory = '';
			}
		}

		if ($directory === null) {
			$directory = $directory ? : $entity->icon_directory;
			if ($entity instanceof \ElggUser) {
				$directory = 'profile';
			} else if ($entity instanceof \ElggGroup) {
				$directory = 'groups';
			} else {
				$directory = $this->config->getDefaultIconDirectory();
			}
		}

		$directory = elgg_trigger_plugin_hook('entity:icon:directory', $entity->getType(), array(
			'entity' => $entity,
			'size' => $size,
				), $directory);

		return trim($directory, '/');
	}
public function getIconDirectory(\ElggEntity $entity, $size = null, $directory = null) {

		$sizes = $this->getSizes($entity);
		if (isset($sizes[$size]['metadata_name'])) {
			$md_name = $sizes[$size]['metadata_name'];
			if ($entity->$md_name) {
				$directory = '';
			}
		}

		if ($directory === null) {
			$directory = $directory ? : $entity->icon_directory;
			if ($entity instanceof \ElggUser) {
				$directory = 'profile';
			} else if ($entity instanceof \ElggGroup) {
				$directory = 'groups';
			} else {
				$directory = $this->config->getDefaultIconDirectory();
			}
		}

		$directory = elgg_trigger_plugin_hook('entity:icon:directory', $entity->getType(), array(
			'entity' => $entity,
			'size' => $size,
				), $directory);

		return trim($directory, '/');
	}
public function getIconDirectory ( \ ElggEntity $ entity , $ size = null , $ directory = null ) { $ sizes = $ this -> getSizes ( $ entity ) ; if ( isset ( $ sizes [ $ size ] [ 'metadata_name' ] ) ) { $ md_name = $ sizes [ $ size ] [ 'metadata_name' ] ; if ( $ entity -> $ md_name ) { $ directory = '' ; } } if ( $ directory === null ) { $ directory = $ directory ? : $ entity -> icon_directory ; if ( $ entity instanceof \ ElggUser ) { $ directory = 'profile' ; } else if ( $ entity instanceof \ ElggGroup ) { $ directory = 'groups' ; } else { $ directory = $ this -> config -> getDefaultIconDirectory ( ) ; } } $ directory = elgg_trigger_plugin_hook ( 'entity:icon:directory' , $ entity -> getType ( ) , array ( 'entity' => $ entity , 'size' => $ size , ) , $ directory ) ; return trim ( $ directory , '/' ) ; }
Determines and normalizes the directory in which the icon is stored

@param \ElggEntity $entity    Entity
@param string     $size      Icon size
@param string     $directory Default directory
@return string
Determines and normalizes the directory in which the icon is stored