@param array $properties

@return array
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];
    }
450241
protected function listProperties(array $properties)
    {
        $headings = [];
        $values = [];
        foreach ($properties as $key => $value) {
            $headings[] = new AdaptiveTableCell($key, ['wrap' => false]);
            $values[] = $this->formatter->format($value, $key);
        }
        /** @var \Platformsh\Cli\Service\Table $table */
        $table = $this->getService('table');
        $table->renderSimple($values, $headings);

        return 0;
    }
1040710
public function setProperties(array $properties)
    {
        if (isset($properties[ 'presets' ])) {
            $this->setPresets($properties[ 'presets' ]);

            unset($properties[ 'presets' ]);
        }

        $this->properties = $properties;

        return $this;
    }
1359573
public function getPageProperties($properties = array())
    {
        $success = 0;
        $data    = array();

        $page = $this->getServiceLocator()->get("MelisPageProperty");

        if(is_array($property))
        {
            $data = $page->getPageProperties($properties);
        }

        return $data;
    }
240528
private function guessType(array $properties)
    {
        $types = ['url', 'route', 'action'];

        foreach ($types as $type) {
            if (array_key_exists($type, $properties)) return $type;
        }

        return null;
    }
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),
        ];
    }
835595
protected static function compile_properties(array $properties, $defaults = true)
	{
		$p = $properties;
		$properties = [];

		foreach ($p as $key => $value)
		{
			if (is_int($key))
			{
				$key = $value;
				$value = [];
			}

			// Get property defaults
			if ($defaults and $property = static::property($key, false))
			{
				$value = array_replace_recursive($property, $value);
			}

			$properties[$key] = $value;
		}

		return $properties;
	}
105234
public function setProperties(array $properties) : DataSet
    {
        $this->properties = [];

        foreach ($properties as $key => $value) {
            $this->addProperty($key, $value);
        }

        return $this;
    }
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);
    }
1018814
protected function resolveProperties(array $properties)
    {
        $class = get_class($this);

        if (!isset(self::$resolversByClass[$class])) {
            self::$resolversByClass[$class] = new OptionsResolver;
            $this->configureProperties(self::$resolversByClass[$class]);
        }

        return self::$resolversByClass[$class]->resolve($properties);
    }
11555
protected function filterNestedContext(array $properties = [])
    {
        $func = function($value, $key) {
            return ($value && $key !== '@context');
        };

        if (!defined('ARRAY_FILTER_USE_BOTH')) {
            $return = [];
            foreach ($properties as $k => $v) {
                if (call_user_func($func, $v, $k)) {
                    $return[$k] = $v;
                }
            }

            return $return;
        }

        return array_filter($properties, $func, ARRAY_FILTER_USE_BOTH);
    }
1201724
public function setPropertiesAsArray($properties)
    {
        if (\is_array($properties)) {
            if (\array_key_exists('id', $properties)) {
                unset($properties['id']);
            }

            foreach ($properties as $propertyName => $value) {
                $this->setProperty($propertyName, $value);
            }
        }
    }
366355
protected function normalizeProperties($properties)
	{
		foreach ($properties as $property => $type)
		{
			if (preg_match('/(.*?)\(\d+\).*/i', $type, $matches))
			{
				$type = $matches[1];

				$properties[$property] = $type;
			}

			switch ($type)
			{
				case 'text':
				case 'tinytext':
				case 'mediumtext':
				case 'longtext':
				case 'blob':
					$properties[$property] = 'text';
				break;

				case 'int':
				case 'integer':
				case 'smallint':
				case 'tinyint':
				case 'bigint':
				case 'mediumint':
				case 'year':
					$properties[$property] = 'integer';
				break;

				case 'datetime':
				case 'date':
				case 'timestamp':
				case 'time':
					$properties[$property] = 'date';
				break;

				case 'varchar':
				case 'char':
				default:
					$properties[$property] = 'string';
				break;
			}
		}

		return $properties;
	}
1130554
public function setProperties( $properties )
    {
        if ( ! empty( $properties ) )
        {
            foreach ( $properties as $name => $value )
            {
                switch ( true )
                {
                    case is_array( $value ) &&
                            array_key_exists( 'value', $value ):
                        $value = (object) $value;

                    case is_object( $value ):
                        if ( ! isset( $value->value ) )
                        {
                            $value->value = null;
                        }

                        if ( ! isset( $value->priority ) )
                        {
                            $value->priority = null;
                        }

                        if ( ! isset( $value->name ) )
                        {
                            $value->name = $name;
                        }

                        $this->setProperty(
                            $value->name,
                            $value->value,
                            $value->priority
                        );
                        break;

                    case is_array( $value ):
                        if ( count( $value ) > 2 )
                        {
                            list( $tmpName, $value, $priority ) = $value;
                            $name = $tmpName ?: $name;
                        }
                        else if ( count( $value ) > 1 )
                        {
                            list( $value, $priority ) = $value;
                        }
                        else
                        {
                            $priority   = null;
                            $value      = empty( $value ) ? null : current( $value );
                        }

                        $this->setProperty( $name, $value, $priority );
                        break;

                    default:
                        $this->setProperty( $name, $value );
                        break;
                }
            }
        }

        return $this;
    }
328184
public function setProperties(array $properties = null)
    {
        ValidationUtility::ensureNullOrArrayOfType(
            '$properties', $properties, __NAMESPACE__ . '\Property');

        $this->properties = $properties;

        return $this;
    }
600585
public function properties (array $properties = array())
    {
        $res = '';
        
        if (!empty($properties)) {
            foreach ($properties as $key => $property) {
                $res .= ' ' . $key . '="' . $property . '"';
            }
        }

        return $res;
    }
91188
public function setProperties(array $properties)
    {
        foreach ($properties as $propertyIdent => $propertyMetadata) {
            if (isset($this->properties[$propertyIdent])) {
                $this->properties[$propertyIdent] = array_replace_recursive(
                    $this->properties[$propertyIdent],
                    $propertyMetadata
                );
            } else {
                $this->properties[$propertyIdent] = $propertyMetadata;
            }
        }

        return $this;
    }