Builds object from array of field values indexed by field name.

@param array $values
@return static
547008
public static function build(array $values)
    {
        $result = new static;

        foreach ($values as $field => $value) {
            /** @var $className TypeInterface */
            $result->$field = $value;
        }

        return $result;
    }
460105
public function values($values) {
		if (is_array($values))
			$this->value = $values;
		else
			$this->valueList = func_get_args();
		return $this;
	}
944967
public function filterByIds(array $values): self
    {
        $fieldPath = Item::getPathByField('id');
        if (!empty($values)) {
            $this->filters['id'] = Filter::create(
                $fieldPath,
                $values,
                Filter::AT_LEAST_ONE,
                Filter::TYPE_FIELD
            );
        } else {
            unset($this->filters['id']);
        }

        return $this;
    }
1299845
public static function createFromArray(array $values)
    {
        $cloud = new self(
            $values['domain'],
            $values['port'],
            $values['path'],
            $values['registerProcedure'],
            $values['protocol']
        );

        return $cloud;
    }
559729
static function fromArray($values)
    {
        if ($values === null) {
            return null;
        }

        ksort($values);

        $serialized = '';
        foreach ($values as $key => $value) {
            if (is_array($value)) {
                list($key, $value) = array($value[0], $value[1]);
            }

            if (strpos($key, ':') !== false) {
                return null;
            }

            if (strpos($key, "\n") !== false) {
                return null;
            }

            if (strpos($value, "\n") !== false) {
                return null;
            }
            $serialized .= "$key:$value\n";
        }
        return $serialized;
    }
1209284
public function setValues(array $values) {
		$this->_data     = $values + $this->_data;
		$this->_changed += array_fill_keys(array_keys($values), true);
		
		return $this;
	}
1258032
public function setValues(array $values)
    {
        foreach ($values as $name => $value) {
            $this->fields->set($name, $value);
        }

        return $this;
    }
1090215
final public function setData(array $values): Model
    {
        if (!is_array($this->data)) {
            $this->data = $values;
        } else {
            $this->data = array_merge($this->data, $values);
        }

        return $this;
    }
1110185
public function process(array $values)
    {
        $results = [];

        foreach ($values as $value) {
            $valueResults = $this->buildSolrHierarchyFromPath($value);
            $results = array_merge($results, $valueResults);
        }

        return array_unique($results);
    }
479783
public function setFromArray(array $values) {
        foreach ($values as $key => $val) {
            $this->set($key, $val);
        }
        return $this;
    }
630674
public function values(array $values)
    {
        $this->sqlParts['values'] = is_array(current($values)) ? $values : [$values];

        return $this;
    }
1212972
public function setFieldsFromArray(Array $fields) {
    foreach ($fields as $field => $value) {
      $this->set($field, $value);
    }
    return $this;
  }
932003
public static function constructFrom($values, $opts = null)
    {
        $obj = new static(isset($values['id']) ? $values['id'] : null);
        $obj->refreshFrom($values, $opts);
        return $obj;
    }
710283
public function values($values)
    {
        if ($values instanceof Collection) {
            $values = $values->toArray();
        }

        $this->values = $values;

        return $this;
    }
308147
public function pullAll(array $values)
    {
        $this->requiresCurrentField();
        $this->newObj['$pullAll'][$this->currentField] = $values;
        return $this;
    }
381291
public function valuesArray($values) {
		if ($values instanceof \ArrayObject)
			$this->value = $values->getArrayCopy();
		elseif (is_object($values))
			$this->value = get_object_vars($values);
		elseif (is_array($values))
			$this->value = $values;
		else
			throw new \InvalidArgumentException("Method 'valuesArray' expected an object or array value");
		
		if (is_numeric(key($this->value))) {
			$this->valueList = $this->value;
			$this->value = null;
		}
		
		return $this;
	}
816541
public static function createFromArray(array $values)
    {
        $vector = new self;

        foreach ($values as $offset => $value) {
            $vector->setElement($offset, new Element($value));
        }

        return $vector;
    }