Get cover size config

@param ElggEntity $entity     Entity whose icons are being handled
@param array      $icon_sizes An array of predefined icon sizes
@return array
173916
protected static function getIconSizes($entity, $icon_sizes = array()) {

		$type = $entity->getType();
		$subtype = $entity->getSubtype();

		$defaults = array(
			'master' => array(
				'h' => 370,
				'w' => 1000,
				'upscale' => true,
				'square' => false,
			)
		);

		if (is_array($icon_sizes)) {
			$icon_sizes = array_merge($defaults, $icon_sizes);
		} else {
			$icon_sizes = $defaults;
		}

		return elgg_trigger_plugin_hook('entity:cover:sizes', $type, array(
			'entity' => $entity,
			'subtype' => $subtype,
				), $icon_sizes);
	}
1238527
protected function generateMethods(Entity $entity)
    {
        $descriptor = $entity->getDescriptor();
        $extensions = $descriptor->getExtensionList() ?: [];
        $methods    = [$this->generateRegisterAllExtensionsMethod($entity)];

        foreach ($extensions as $field) {
            $methods[] = $this->generateExtensionMethod($entity, $field);
        }

        return $methods;
    }
1035468
protected function generateBody(Entity $entity)
    {
        $lines      = [];
        $fields     = [];
        $extensions = [];
        $descriptor = $entity->getDescriptor();

        if ($descriptor->hasOptions()) {
            $lines   = $this->createOptionsBody($entity);
            $lines[] = null;
        }

        foreach (($descriptor->getFieldList() ?: []) as $field) {
            $values = $this->generateFieldBody($field);
            $fields = array_merge($fields, $this->addIndentation($values, 2));
        }

        foreach (($descriptor->getExtensionList() ?: []) as $field) {
            $values     = $this->generateFieldBody($field);
            $extensions = array_merge($extensions, $this->addIndentation($values, 2));
        }

        $lines[] = "return \google\protobuf\DescriptorProto::fromArray([";
        $lines[] = "    'name'      => " . var_export($descriptor->getName(), true) . ",";

        if ( ! empty($fields)) {
            $lines[] = "    'field'     => [";
            $lines   = array_merge($lines, $fields);
            $lines[] = "    ],";
        }

        if ( ! empty($extensions)) {
            $lines[] = "    'extension' => [";
            $lines   = array_merge($lines, $extensions);
            $lines[] = "    ],";
        }

        if ($descriptor->hasOptions()) {
            $lines[] = "    'options' => \$options";
        }

        $lines[] = "]);";

        return $lines;
    }
101083
private function getCategoryIdsLimitation($entity)
    {
        $searchContainerData = $entity->getData('catalog_view_container');
        $applyTo     = is_array($searchContainerData) ? ((bool) $searchContainerData['apply_to'] ?? false) : false;
        $categoryIds = ($applyTo === false) ? [] : $searchContainerData['category_ids'] ?? [];

        return $categoryIds;
    }
801971
public function getObjectAclEntriesAsArray($entity)
    {
        $result = array();
        foreach ($this->getObjectAclEntries($entity) as $aclEntry) {
            $result[] = new AclEntry($aclEntry->getSecurityIdentity());
        }
        return $result;
    }
1064750
public function getImageCalSize($imagesize=array(),$image_config=array())
    {
        $r = array();
        if(count($imagesize)>0 && isset($imagesize[0],$imagesize[1]) && count($image_config)>0){
            if ($image_config[2]===true && $image_config[3]===null) {
                $por =  $image_config[0] / $imagesize[0];
                $height = round($imagesize[1] * $por);
                $r[0] = $image_config[0];
                $r[1] = $height;
            }elseif ($image_config[2]===null && $image_config[3]===true) {
                $por =  $image_config[1] / $imagesize[1];
                $width = round($imagesize[0] * $por);
                $r[0] = $width;
                $r[1] = $image_config[1];
            }else{
                $r[0] = $image_config[0];
                $r[1] = $image_config[1];
            }
        }
        return $r;
    }
680292
public function getSubtypeOptions() {
		$types = get_registered_entity_types();
		$types = elgg_trigger_plugin_hook('search_types', 'get_queries', [], $types);

		return elgg_extract($this->getEntityType(), $types);
	}
1331329
protected function wrapInEntities(array $entities)
    {
        $results = array();
        foreach ($entities as $entity) {
            $results[] = self::getEntity($entity);
        }

        return $results;
    }
361710
public function getEntityArrayValues($entity)
    {
        $values = [];
        $properties = $this->getEntityProperties($entity);
        $metadata = $this->em->getClassMetadata(get_class($entity));
        foreach ($properties as $property) {
            $values[$property] = $metadata->getFieldValue($entity, $property);
        }
        return $values;
    }
1372583
protected function generateBody(Entity $entity)
    {
        $descriptor = $entity->getDescriptor();
        $fields     = $descriptor->getFieldList() ?: [];
        $extLines   = $this->generateExtensionsSerializedSize($entity);

        $body[] = '$calculator = $context->getSizeCalculator();';
        $body[] = '$size       = 0;';
        $body[] = null;

        foreach ($fields as $field) {
            $lines = $this->generateFieldCondition($entity, $field);
            $body  = array_merge($body, $lines, [null]);
        }

        $body   = array_merge($body, $extLines);
        $body[] = null;
        $body[] = 'return $size;';

        return $body;
    }
665517
public function getBlockVariables($field, $entity)
    {
        $defaults = parent::getBlockVariables($field, $entity);

        return [
            'value' => $defaults['value'],
            'truncate' => $field->getOption('truncate', 80),
            'escape' => $field->getOption('escape', true),
        ] + $defaults;
    }
238437
protected function mergeEntityMethods($entity, $entityNormalized, $entityMethods, $key = '_entityMethods')
    {
        if (!is_array($entityNormalized)) {
            return $entityNormalized;
        }

        foreach ($entityMethods as $entityMethod) {
            $methodEntity = $entity;
            $name = $entityMethod->getName();
            $params = $entityMethod->getParams();
            $attributes = $entityMethod->getAttributes();
            $subEntities = $entityMethod->getSubEntities();

            foreach ($subEntities as $subEntity) {
                $methodEntity = $methodEntity->{"get${subEntity}"}();
            }

            if (count($subEntities) === 0) {
                if (!isset($entityNormalized[$key])) {
                    $entityNormalized[$key] = [];
                }

                $data = $methodEntity->$name(...$params);

                if ($attributes) {
                    $data = $this->serializer->normalize(
                        $data,
                        null,
                        $this->getNormalizeContext($this->normalizeContext, $attributes)
                    );
                }

                $entityNormalized[$key][$name] = $data;
                continue;
            }

            foreach ($subEntities as $i => $subEntity) {
                if (!isset($entityNormalized[$subEntity])) {
                    $entityNormalized[$subEntity] = [];
                }

                $subEntityNormalized = &$entityNormalized[$subEntity];

                if ($i === count($subEntities) - 1) {
                    if (!isset($subEntityNormalized[$key])) {
                        $subEntityNormalized[$key] = [];
                    }

                    $data = $methodEntity->$name(...$params);

                    if ($attributes) {
                        $data = $this->serializer->normalize(
                            $data,
                            null,
                            $this->getNormalizeContext($this->normalizeContext, $attributes)
                        );
                    }

                    $subEntityNormalized[$key][$name] = $data;
                }
            }
        }

        return $entityNormalized;
    }
1076569
public function mapEntity(Entity $entity) {
		$entity['_loc'] = $this->_table->getUrl($entity);
		$entity['_lastmod'] = $entity->{$this->_config['lastmod']};
		$entity['_changefreq'] = $this->_config['changefreq'];
		$entity['_priority'] = $this->_config['priority'];

		return $entity;
	}
254539
public function getEntityChangeSet($entity)
    {
        $oid = spl_object_hash($entity);

        if (isset($this->entityChangeSets[$oid])) {
            return $this->entityChangeSets[$oid];
        }

        return array();
    }
853203
public function getIconString($icon, $class = '', $width = '', $height = '')
    {
        $string = $this->loadFile(__DIR__.'/../../resources/assets/icons/'.$icon.'.svg');
        $string = substr_replace($string, ' class="'.$class.'"', 4, 0);

        if ($width) {
            $string = substr_replace($string, 'width="'.$width.'"', strpos($string, 'width='), 10);
            $string = substr_replace($string, 'height="'.$height.'"', strpos($string, 'height='), 11);
        }

        return $string;
    }
1137131
public function getBusinessEntityExtends()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $aExtends = [];

        foreach ($this->_aBusinessEntityExtends as $sExtend) {
            $aExtends[$sExtend] = $myConfig->getConfigParam($sExtend);
        }

        return $aExtends;
    }
1275603
protected function getConfigNames($config_type)
    {
        $names = [];
        // For a given entity type, load all entities.
        if ($config_type && $config_type !== 'system.simple') {
            $entity_storage = $this->entityTypeManager->getStorage($config_type);
            foreach ($entity_storage->loadMultiple() as $entity) {
                $entity_id = $entity->id();
                $label = $entity->label() ?: $entity_id;
                $names[$entity_id] = $label;
            }
        }
        // Handle simple configuration.
        else {
            // Gather the config entity prefixes.
            $config_prefixes = array_map(
                function ($definition) {
                    return $definition->getConfigPrefix() . '.';
                }, $this->definitions
            );

            // Find all config, and then filter our anything matching a config prefix.
            $names = $this->configStorage->listAll();
            $names = array_combine($names, $names);
            foreach ($names as $config_name) {
                foreach ($config_prefixes as $config_prefix) {
                    if (strpos($config_name, $config_prefix) === 0) {
                        unset($names[$config_name]);
                    }
                }
            }
        }

        return $names;
    }