Set offers attributes.

@param  mixed $values
@return array
181861
protected function setOffersAttribute($values)
    {
        if (is_array($values)) {
            foreach($values as $key => $value) {
                $values[$key] = $this->mapProperty([
                    'name' => '',
                    'price' => '',
                    'url' => '',
                ], $value);
            }
        }

        return $values;
    }
1005684
protected function setForeignKeys(array $values)
    {
        foreach ($values as $key => &$value) {
            if ($this->endsWith($key, '_id')) {
                $value = $this->generateKey($value);
            }
        }

        return $values;
    }
590086
public function choicesForValue(array $values = []): array
    {
        $choices = $this->choices();
        $selected = [];
        foreach ($values as $value) {
            if (array_key_exists($value, $this->choices)) {
                $selected[$value] = $choices[$value];
            }
        }

        return $selected;
    }
339819
public function setTableAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->tableAttributes[$attribute] = $value;
        }

        return $this;
    }
972832
public function setAttributes(Array $attributes) {

		foreach($attributes as $k => $v) {
			$this->setAttribute($k, $v);
		}
		return $this;

	}
1082825
public function setAllValues(array $values)
    {
        foreach ($values as $key => $value) {
            $this->$key = $value;
        }

        return $this;
    }
609047
protected function detectValues($values): array
    {
        if (!is_array(reset($values))) {
            $values = [$values];
        } else {
            foreach ($values as $key => $value) {
                ksort($value);
                $values[$key] = $value;
            }
        }

        return $values;
    }
626408
public function setValuesAttribute(array $values = [])
    {
        static::saved(function ($model) use ($values) {
            $savedIds = [];
            foreach ($values as $data) {
                if (empty(array_filter($data))) {
                    continue;
                }
                // Create option or enable it if exists
                $value = $this->values()->updateOrCreate([
                    'code' => $data['code'],
                ], $data);
                $savedIds[] = $value->id;
            }
            $this->values()->whereNotIn('id', $savedIds)->delete();
        });
    }
298657
public function setValues(array $values)
    {
        $this->getValidator()->validateRequired($values, $this->required);
        $this->values = array_merge($this->values, $values);
        
        return $this;
    }
619155
protected function encodeValues($values)
    {
        if (is_null($this->connection) || $this->type == AttributeConverterInterface::TYPE_SEARCH_FROM) {
            return $values;
        }
        $encoded = is_array($values) ? $values : [$values];

        foreach ($encoded as $index => $value) {
            if (is_string($value)) {
                $encoded[$index] = LdapUtilities::encode($value, $this->connection->getConfig()->getEncoding());
            }
        }

        // This is to pass it back the same way it was received. ldap_modify_batch is picky about values being an array.
        return is_array($values) ? $encoded : reset($encoded);
    }
132886
public function setMany(array $values)
    {
        if ($this->getResource()) {
            foreach ($values as $key => $value) {
                $this->set($key, $value);
            }
        }
        return $this;
    }
1297848
private function setValues($values)
    {
        $values = $this->checkContent($values);

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

        return $this->addManyValues($values);
    }
732930
public function setSelected(array $values)
	{
		$this->assertMultiSelect();

		$candidates = array();
		/* @var $candidates SelectOption[] */

		foreach ( $this->getOptions() as $option ) {
			if ( in_array($option->getValue(), $values) ) {
				$candidates[] = $option;
			}
		}

		return $this->selectOptions($candidates);
	}
1213760
public function setAttributes($values)
    {
        if (!is_array($values)) {
            return;
        }
        foreach ($values as $name => $value) {
            $this->$name = $value;
        }
    }
1264500
public function setValues($values)
    {
        if (!$this->rows) {
            throw new \Exception('You must setRows() before setValues');
        }
        $this->values = $values;

        $valueCount = count($values);
        $fieldCount = count($this->rows);

        // Build the Placeholder String
        $placeholders = [];
        for ($i = 0; $i < $valueCount; $i++) {
            $placeholders[] = '(' . rtrim(str_repeat('?,', $fieldCount), ',') . ')';
        }
        $this->bindString = implode(',', $placeholders);

        // Build the Flat Value Array
        $valueList = [];
        foreach ($values as $value) {
            if (is_array($value)) {
                foreach ($value as $v) {
                    $valueList[] = $v;
                }
            } else {
                $valueList[] = $values;
            }
        }
        $this->valuesFlattened = $valueList;
        unset($valueList);

        return $this;
    }
860692
public function setSlugAttribute($value)
    {
        array_set($this->attributes, $this->getSlugKey(), $this->makeSlug($value));
    }
1064800
public function values($values)
    {
        $values = func_num_args() > 1 ? func_get_args() : (array) $values;
        $this->options = array_combine($values, $values);

        return $this;
    }