Maps the properties to array with actual values.
For another properties-mapping, please override this method.

@param array $properties

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

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

        return $map;
    }
1194744
private function splitOnVisibilityAndMapToClasses(array $properties): array
    {
        return \array_reduce($properties, function (array $tuple, Property $p) {
            $tuple[$this->isPrivate($p) ? 0 : 1][] = $p->getClassName();

            return $tuple;
        }, [[], []]);
    }
1139178
protected function valPropValues(array $values)
    {
        $validPropertyValues = [];

        // Run through all property values
        /** @var ValueInterface $value */
        foreach ($values as $value) {
            $this->procPropValue($value, $validPropertyValues);
        }

        return $validPropertyValues;
    }
903228
public function sets(array $properties)
  {
    foreach($properties as $k => $v){
      $this->set($k, $v);
    }
    return $this;
  }
303775
public function Field($properties = array())
    {
        $options = array();

        foreach ($this->getOptions()->filter('Selected', true) as $option) {
            $options[] = $option->Title;
        }

        $field = ReadonlyField::create($this->name . '_Readonly', $this->title);

        $field->setForm($this->form);
        $field->setValue(implode(', ', $options));
        return $field->Field();
    }
429561
public function toArray($properties = null)
    {
        $array = [];

        if (!empty($this->getMeta())) {
            $array['meta'] = $this->getMeta();
        }

        if (!empty($this->getPropertyContainer())) {
            $array['properties'] = [];

            foreach ($this->getPropertyContainer()->getProperties() as $item) {
                if (method_exists(
                    $item,
                    'toArray'
                )) {
                    $array['properties'][] = $item->toArray();
                }
            }
        }
        if (!empty($this->getDatabaseContainer())) {
            $array['database'] = $this->getDatabaseContainer()->getDatabase()->toArray();
        }

        return $array;
    }
1327689
public function flat(array $properties): string
    {
        Assert::isMap($properties);

        return $this->arrayImploder->byGlue($properties, ';', ':');
    }
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;
    }
494208
protected function setProperties(array $properties = [])
    {
        foreach ($properties as $name => $value) {
            // set property
            if (property_exists($this, $name)) {
                $this->$name = $value;

            // unknown property found
            } else {
                trigger_error(
                    sprintf(
                        'unknown property "%s" for "%s"',
                        $name,
                        get_class($this)
                    ),
                    E_USER_WARNING
                );
            }
        }
    }
939705
public static function fromProperties(array $properties)
    {
        $copy = new self();
        foreach (self::getPropertyNames() as $name) {
            if (isset($properties[$name])) {
                $copy->{'set'.ucfirst($name)}($properties[$name]);
            }
        }

        return $copy;
    }
923628
public function convertArrayToObjects(array $properties, Specificity $specificity = null)
    {
        $objects = array();

        foreach ($properties as $property) {
            $object = $this->convertToObject($property, $specificity);
            if ($object === null) {
                continue;
            }

            $objects[] = $object;
        }

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

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

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

        $this->properties = $properties;

        return $this;
    }
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];
    }
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);
    }
105234
public function setProperties(array $properties) : DataSet
    {
        $this->properties = [];

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

        return $this;
    }
1033249
public function validateProperties(array $properties)
    {
        $definedProperties = $this->defineProperties() ?: [];

        /*
         * Determine and implement default values
         */
        $defaultProperties = [];

        foreach ($definedProperties as $name => $information) {
            if (array_key_exists('default', $information)) {
                $defaultProperties[$name] = $information['default'];
            }
        }

        $properties = array_merge($defaultProperties, $properties);

        return $properties;
    }