Get the properties after applying the predefined keys.

@param array $properties
@param array $languages

@return $this
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;
    }
778478
public function setProperties(array $properties = [])
    {
        foreach ($properties as $property => $value) {
            $method = 'set'.ucfirst($property);
            if (!method_exists($this, $method)) {
                throw new \RuntimeException("Undefined method $method.");
            }

            if (!in_array($property, $this->validProperties)) {
                throw new \Exception('You are trying to set invalid properties. Please check valid properties.');
            }

            $this->{$method}($value);
        }
    }
1198820
protected function setForeignConstraintFromArray(array $properties)
    {
        $foreignConstraint = $this->getForeignConstraintFromArray($properties);

        $this->setForeignConstraint($foreignConstraint);

        if ($this->hasForeignConstraint() && !$this->hasForeignRelation()) {
            $this->setForeignRelation($foreignConstraint->getForeignRelation());
        }

        return $this;
    }
909444
protected static function getIndexes(array $properties)
    {
        $indexes = [];

        foreach ($properties as $property) {
            $indexes[] = Index::get($property);
        }

        return $indexes;
    }
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);
    }
613806
public function setSupportedLanguages(array $languages)
    {
        $this->languages = $languages;
        $this->fallbackLanguage = reset($languages);

        return $this;
    }
1093742
public function setRange(array $properties)
    {
        if (self::isValidSelectRangeType($properties)) {
            $this->range = explode(':', substr($properties['html-type'], 12));
        }

        if (Helpers::isKeyExists($properties, 'range') && is_array($properties['range'])) {
            $this->range = $properties['range'];
        }

        return $this;
    }
600694
public function setUnsigned(array $properties)
    {
        $this->isUnsigned = (Helpers::isKeyExists($properties, 'is-unsigned') && $properties['is-unsigned'])
        || in_array($this->getEloquentDataMethod(), $this->unsignedTypes);

        return $this;
    }
203208
public function setOnUpdate(array $properties)
    {
        if (array_key_exists('on-update', $properties)) {
            $this->onUpdate = $this->getOnAction($properties['on-update']);
        }

        return $this;
    }
685529
public function loadTranslations($languages)
    {
        $languages = (array)$languages;

        foreach ($languages as $language) {
            $this->getTranslation($language);
        }
    }
1183270
public function from($collection, $properties = null) {
		$this->_collection = $collection;
		
		if (is_string($properties) || is_array($properties)) {
			$this->_properties = (array) $properties;
		}
		
		return $this;
	}
441865
protected function getMissingBaseProperties(array $properties = null)
    {
        $basePropertyKeys = PropertyIds::getBasePropertyKeys();

        if ($properties === null) {
            return $basePropertyKeys;
        }

        foreach ($properties as $property) {
            $propertyId = $property->getId();
            $basePropertyKey = array_search($propertyId, $basePropertyKeys);
            if ($basePropertyKey !== false) {
                unset($basePropertyKeys[$basePropertyKey]);
            }
        }

        return $basePropertyKeys;
    }
758614
public function setMultipleProperties(array $properties)
    {
        $this->parseStyleAttribute();

        foreach ($properties as $propertyName => $value) {
            if (!is_string($propertyName)) {
                throw new InvalidArgumentException(sprintf('Property name must be a string, %s given', (is_object($propertyName) ? get_class($propertyName) : gettype($propertyName))));
            }

            if (!is_string($value)) {
                throw new InvalidArgumentException(sprintf('Property value must be a string, %s given', (is_object($value) ? get_class($value) : gettype($value))));
            }

            $this->properties[$propertyName] = $value;
        }

        $this->updateStyleAttribute();

        return $this;
    }
292075
public function makeArrayTranslatable(Schema $property, $languages)
    {
        $property->setType('array');
        $property->setItems($this->makeTranslatable(new Schema(), $languages));
        return $property;
    }
1198068
public function setTranslations(array $translations)
    {
        if (gettype($translations) == 'array') {
            $translations = new ArrayCollection($translations);
        }

        $this->translations = $translations;

        return $this;
    }
274486
public function makeTranslatable(Schema $property, $languages)
    {
        $property->setType('object');
        $property->setTranslatable(true);

        array_walk(
            $languages,
            function ($language) use ($property) {
                $schema = new Schema;
                $schema->setType('string');
                $schema->setTitle('Translated String');
                $schema->setDescription('String in ' . $language . ' locale.');
                $property->addProperty($language, $schema);
            }
        );
        $property->setRequired(['en']);
        return $property;
    }
454118
protected function valProperties(array $properties)
    {
        $validatedProperties = $this->propertyListFactory->create();

        // Run through all validated properties
        foreach (array_filter(array_map([$this, 'valProp'], $properties)) as $property) {
            $validatedProperties->add($property);
        }

        return $validatedProperties;
    }