It will get the provided labels from with the $properties's 'label' or 'labels' property

@param array $properties

@return array
508026
protected function getLabelsFromProperties(array $properties)
    {
        if (!Helpers::isKeyExists($properties, 'labels')) {
            throw new Exception('The resource-file is missing the labels entry for the ' . $this->name . ' field.');
        }

        if (is_array($properties['labels'])) {
            //At this point we know this the label
            return $this->getLabelsFromArray($properties['labels']);
        }

        return [
            new Label($properties['labels'], $this->localeGroup, true, $this->defaultLang),
        ];
    }
19484
protected function parseProperties(array $properties, string $slug)
    {
        switch (count($properties)) {
            case 1:
                // Square with defaults.
                return [$properties[0], $properties[0], false, false];
                break;
            case 2:
                // Custom size with defaults.
                return [$properties[0], $properties[1], false, false];
                break;
            case 3:
                // Custom size with custom crop option.
                return [$properties[0], $properties[1], $properties[2], false];
                break;
            case 4:
            default:
                // All properties with custom label.
                $label = (is_bool($properties[3]) && true === $properties[3]) ? $this->label($slug) : $properties[3];

                return [$properties[0], $properties[1], $properties[2], $label];
        }
    }
213237
protected static function getRelations(array $properties)
    {
        $relations = [];

        foreach ($properties as $property) {
            if (!is_null($relation = ForeignRelationship::get($property))) {
                $relations[] = $relation;
            }
        }

        return $relations;
    }
682220
public function sliceProperties(array $properties)
    {
        $actions = $this->internalDataListActions;
        $actions[] = ['sliceProperties', $properties];
        $data = $this->internalDataListUpdateData($this->internalDataListData, $actions);
        $className = get_class($this);
        $list = new $className();
        $class = $this->internalDataListClasses['IvoPetkov\DataListObject'];
        $tempObject = new $class();
        foreach ($data as $index => $object) {
            $object = $this->internalDataListUpdateValueIfNeeded($data, $index);
            $newObject = clone($tempObject);
            foreach ($properties as $property) {
                $newObject[$property] = isset($object->$property) ? $object->$property : null;
            }
            $list->push($newObject);
        }
        return $list;
    }
184144
protected function ensureFormatProperties(array $properties)
	{
		// defaults keys for transforming
		$properties += [
			'bit_rate'    => 0,
			'duration'    => 0.0,
			'format_name' => '',
			'tags'        => [],
			'codecs'      => []
		];
		
		if ( ! empty($this->options[ServiceFactoryInterface::OPTION_TEST_CODECS]))
		{
			$properties['codecs'] = $this->getAvailableCodecs();
		}
		
		$properties['metadata'] = (array) $properties['tags'];
		$properties['format'] = $properties['format_name'];
		$properties['bitrate'] = $properties['bit_rate'];
		
		unset($properties['tags'], $properties['bit_rate']);
		
		return $properties;
	}
1143180
protected function getKeyValueStringsFromLabels(array $labels)
    {
        return array_map(function ($label) {
            if (!$label->isPlain) {
                return sprintf("'%s' => %s", $label->value, $this->getTranslatedTitle($label));
            }

            return sprintf("'%s' => '%s'", $label->value, $label->text);
        }, $labels);
    }
868055
public function extract(string ...$properties): MapInterface
    {
        $map = new Map('string', 'mixed');

        foreach ($properties as $property) {
            $map = $map->put(
                $property,
                $this->extractProperty($property)
            );
        }

        return $map;
    }
503039
public function presetProperties(array &$properties)
    {
        $definitions = Config::getCommonDefinitions();
		
        foreach ($definitions as $definition) {
            $patterns = $this->getArrayByKey($definition, 'match');

            if (Helpers::strIs($patterns, $properties['name'])) {
                //auto add any config from the master config
                $settings = $this->getArrayByKey($definition, 'set');
				
                foreach ($settings as $key => $setting) {
					
                    if (!Helpers::isKeyExists($properties, $key) || empty($properties[$key])) {
                        $properties[$key] = $setting;
                    }
                }
            }
        }

        return $this;
    }
433219
protected function map(array $properties)
    {
        $map = array();

        foreach ($properties as $name => $default) {
            $map[$name] = (true === empty($this->$name)) ? $default : $this->$name;
        }

        return $map;
    }
12941
protected function buildContext(array $properties)
    {
        $items = [];

        foreach ($properties as $key => $value) {
            $items[] = [
                    'Key' => $this->sanitizeString($key),
                    'Value' => $this->sanitizeString($value),
            ];
        }

        if (!$items) {
            return [];
        }

        return ['Entry' => $items];
    }
1044931
public function setOptionsProperty(array $properties)
    {
        if (Helpers::isKeyExists($properties, 'options') && is_array($properties['options'])) {
            $labels = $this->transferOptionsToLabels($properties['options']);

            foreach ($labels as $label) {
                $this->addOption($label->text, $label->isPlain, $label->lang, $label->value);
            }

        }

        return $this;
    }
389213
public function buildPropertiesString(array $properties)
    {
        $chunks = array();

        foreach ($properties as $property) {
            $chunks[] = $property->toString();
        }

        return implode(' ', $chunks);
    }
418929
protected function generateStyle(array $properties)
	{
		ksort($properties);

		$style = '';
		foreach ($properties as $name => $value)
		{
			$style .= $name . ':' . $value . ';';
		}

		return trim($style, ';');
	}
114372
protected static function setIconAttribute(array $properties)
    {
        $icon = array_get($properties, 'attributes.icon');
        if (!is_null($icon)) {
            $properties['icon'] = $icon;

            array_forget($properties, 'attributes.icon');

            return $properties;
        }

        return $properties;
    }
816661
public function setup(array $properties) {
        if (is_array(reset($properties))) {
            $modelList = array();
            foreach ($properties as $p) {
                $o = clone $this;
                $o->setupOne($p);
                $modelList[] = $o;
            }
            return $modelList;
        }

        return $this->setupOne($properties);
    }
398751
protected static function getListfilter($properties)
    {
        return function ($item) use ($properties) {
            foreach ($properties as $property => $value)
                if (static::get($item, $property) != $value)
                    return false;
            return true;
        };
    }
1281873
protected function _getInputHelp(array $properties) : string
    {
        $config = (new ModuleConfig(ConfigType::MODULE(), $properties['controller']))->parseToArray();
        $typeaheadFields = !empty($config['table']['typeahead_fields']) ? $config['table']['typeahead_fields'] : [];
        // if no typeahead fields, use display field
        if (empty($typeaheadFields)) {
            $typeaheadFields = [$properties['displayField']];
        }

        $virtualFields = !empty($config['virtualFields']) ? $config['virtualFields'] : [];

        // extract virtual fields, if any
        $result = [];
        foreach ($typeaheadFields as $typeaheadField) {
            $fields = isset($virtualFields[$typeaheadField]) ?
                (array)$virtualFields[$typeaheadField] :
                [$typeaheadField];

            $result = array_merge($result, $fields);
        }

        return implode(', or ', array_map(function ($value) {
            return Inflector::humanize($value);
        }, $result));
    }