Sets or adds values to the row cols
@param mixed $values
484137
protected function _addOrSetValues($values,$callback) {
		$count=$this->count();
		if (!\is_array($values)) {
			$values=\array_fill(0, $count, $values);
		} else {
			if (JArray::isAssociative($values) === true) {
				$values=\array_values($values);
			}
		}
		$count=\min(\sizeof($values), $count);

		for($i=0; $i < $count; $i++) {
			$cell=$this->content[$i];
			$callback($cell,$values[$i]);
		}
		return $this;
	}
636498
public function setValues(array $values)
    {
        foreach ($values as $value) {
            $this->checkType(\DateTime::class, $value, true);
        }
        parent::setValues($values);
    }
1336380
public function setValues($values=array()) {
		return $this->_addOrSetValues($values, function(HtmlTD &$cell,$value){$cell->setValue($value);});
	}
1244726
public function setValues(array $values)
    {
        foreach ($values as $name => $value) {
            if ($element = $this->get($name)) {
                $element->setValue($value);
            }
        }
        return $this;
    }
1098669
public function addValues(array $values = [])
    {
        $this->assertCanHaveMultipleValues();

        foreach ($values as $value) {
            $this->addValue($value);
        }

        return $this;
    }
448984
public function fill_values($values) {
        $values = (array)$values;

        foreach ($values as $key => $value) {
            $found = 0;
            if ($attribute = $this->get_attribute($key)) { // Set value for attributes
                $attribute->set_value($value);
                $found++;
            }
            if ($final = $this->get_final_element($key)) { // Set value for final elements
                $final->set_value($value);
                $found++;
            }
            if (isset($this->aliases[$key])) { // Last chance, set value by processing final element aliases
                $this->aliases[$key]->set_value($value);
                $found++;
            }
            // Found more than once, notice
                // TODO: Route this through backup loggers
            if ($found > 1) {
                debugging('Key found more than once ' . $key, DEBUG_DEVELOPER);
            }
        }

    }
845571
public function mergeValuesBase(array $values): void
  {
    if ($this->name==='')
    {
      // Nothing to do.
      ;
    }
    elseif (isset($values[$this->name]))
    {
      $values = &$values[$this->name];
    }
    else
    {
      $values = null;
    }

    if ($values!==null)
    {
      foreach ($this->options as $id => $option)
      {
        if (array_key_exists($option[$this->keyKey], $values))
        {
          $this->options[$id][$this->checkedKey] = !empty($values[$option[$this->keyKey]]);
        }
      }
    }
  }
1069343
public function setMetadataValues($values)
    {
        foreach ($values as $name => $value) {
            $this->metadata[$name] = $value;
        }
    }
1236782
private function setValues($values)
    {
        if (! empty($values)) {
            if ($this->canHaveMultipleValues()) {
                $this->addValues($values);
            } elseif ($this->canHaveValue()) {
                $this->addValue($values);
            }
        }

        return $this;
    }
1297848
private function setValues($values)
    {
        $values = $this->checkContent($values);

        if ($this->isSingleValued()) {
            return $this->addValue($values[0], true);
        }

        return $this->addManyValues($values);
    }
904968
protected function addUpdatedAtColumn(array $values)
    {
        if (! $this->model->usesTimestamps()) return $values;

        $column = $this->model->getUpdatedAtColumn();

        return array_add($values, $column, $this->model->freshTimestampString());
    }
949045
public function setTextareaDimensions($cols = null, $rows = null)
    {
        if ($cols) {
            $this->fields['default']->cols = $cols;
        }
        if ($rows) {
            $this->fields['default']->rows = $rows;
        }
    }
674323
private function beforePut(array &$values): void {
    $keys = array_keys($values);

    foreach($keys as &$column) {
      if(array_key_exists($column, $this->to_db)) {
        $column = $this->to_db[$column];
      }
    }

    unset($column);

    $values = array_combine($keys, array_values($values));
  }
344203
public function addCategoryValues($values)
    {
        $this->_categoryValues = array_unique(array_merge($this->getCategoryValues(true), $this->filterCategoryValues($values)));
    }
1249142
public function bindValues($values)
    {
        $this->prepare();

        foreach ($values as $k => $value) {
            $this->statement->bindValue($k, $value);
        }

        return $this;
    }
596098
public function setMultiple(array $values)
    {
        foreach ($values as $column => $value) {
            $this->set($column, $value);
        }

        return $this;
    }
642194
public function setFields($values)
    {
        foreach ($values as $field => $value) {
            $this->setField($field, $value);
        }
    }