Changes form values from empty strings to null.
@param array|object $values Submitted values from form.
494215
public static function nullifyStrings(&$values) {
		foreach($values as $key => $value) {
			if(is_array($values)) {
				$item = &$values[$key];
			} else if(is_object($values)) {
				$item = &$values->{$key};
			} else {
				$item = null;
			}
			
			if(is_array($item) or is_object($item)) {
				Values::nullifyStrings($item);
			}
			
			Values::nullifyString($item);
		}
	}
862529
public function setValues(array $values)
    {

        foreach ($values as & $value) {
            if (PHP_INT_SIZE == 4 && is_double($value)) {
                //TODO: 32bit - handle this specially?
                $value = $this->castValueToSimpleType('integer', $value);
            }

            $this->checkType('integer', $value, true);
        }

        parent::setValues($values);
    }
451508
public function setFields($values)
    {
        foreach ($values as $field => $value) {
            $this->_setFieldValue($field, $value);
        }
    }
1336380
public function setValues($values=array()) {
		return $this->_addOrSetValues($values, function(HtmlTD &$cell,$value){$cell->setValue($value);});
	}
1077036
public void setValues(final Set<String> values) {
        getValues().clear();
        if (values == null) {
            return;
        }
        getValues().addAll(values);
    }
1235715
public function mergeValuesBase(array $values): void
  {
    if (array_key_exists($this->name, $values))
    {
      $this->setValuesBase($values);
    }
  }
966807
public function setAll(array $values): void {
		$skipped = array();
		
		foreach ($values as $key => $value) {
			try {
				$this->set($key, $value);
			} catch (EntityException $e) {
				$skipped[$key] = $value;
			}
		}
		
		if (($skippedCount = sizeof($skipped)) > 0) {
			$message = sprintf("Unknown %s (%s) in %s.",
				$skippedCount === 1 ? "property" : "properties",
				join(", ", $skipped),
				get_class()
			);
			
			throw new EntityException($message, EntityException::UNKNOWN_PROPERTY);
		}
	}
1317147
protected function setFields($values)
    {
        foreach ($values[0]->fields as $name => $field) {
            $this->fields[$name] = $field;
        }
    }
987173
public void setValues(java.util.Collection<Value> values) {
        if (values == null) {
            this.values = null;
            return;
        }

        this.values = new java.util.ArrayList<Value>(values);
    }
255889
protected function removeEmptyValues($values)
    {
        if (!is_array($values)) {
            return empty($values) ? null : $values;
        }

        foreach ($values as $key => $value) {
            if (!empty($value)) {
                continue;
            }
            unset($values[$key]);
        }

        return $values;
    }
1050165
public static function setValuesToObject($object, $values = null) {
		if (! isset ( $values ))
			$values = $_POST;
		foreach ( $values as $key => $value ) {
			$accessor = "set" . ucfirst ( $key );
			if (method_exists ( $object, $accessor )) {
				$object->$accessor ( $value );
				$object->_rest [$key] = $value;
			}
		}
	}
299950
public static function setSettings( array $values )
	{
		foreach ($values as $name => $value)
			self::setSetting($name, $value);
	}
148342
public function setValues($values) {

		if(false === is_array($values)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($values)), E_USER_ERROR);
		}

		$this -> values = $values;

		return $this;
	}
323102
public function setValuesSafe(array $values = [])
    {
        $blacklist = is_array(static::$blacklist) ? static::$blacklist : [static::$primary_key];

        foreach ($values as $key => $value) {
            if (!in_array($key, $blacklist) && isset(self::$column_cache[get_called_class()][$key])) {
                $this->set($key, $values[$key]);
            }
        }
    }
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;
    }
364555
protected function edit(array $values)
    {
        $values =
            $this->dispatchBeforeOperationEvent(
                    '\RedKiteLabs\RedKiteCms\RedKiteCmsBundle\Core\Event\Content\Page\BeforePageEditingEvent',
                    PageEvents::BEFORE_EDIT_PAGE,
                    $values,
                    array(
                        'message' => 'exception_page_editing_aborted',
                        'domain' => 'exceptions',
                    )
            );

        try {
            $this->validator->checkEmptyParams($values);
            $this->pageRepository->startTransaction();

            if (isset($values['PageName']) && $values['PageName'] != "" && $this->alPage->getPageName() != $values['PageName']) {
                $values['PageName'] = $this->slugify($values['PageName']);
            } else {
                unset($values['PageName']);
            }

            $templateChanged = '';
            if (isset($values['TemplateName']) && $values['TemplateName'] != "") {
                $templateChanged = $this->alPage->getTemplateName();
                if ($templateChanged != $values['TemplateName']) {
                     $values['oldTemplateName'] = $templateChanged;
                }
            } else {
                unset($values['TemplateName']);
            }

            if (array_key_exists('IsHome', $values) && $this->alPage->getIsHome() == 1 && $values['IsHome'] == 0) {
                throw new PageException\HomePageCannotBeDegradedException('exception_home_page_cannot_be_degraded');
            }

            $result = true;
            if (isset($values['IsHome']) && $values['IsHome'] != "" && $values['IsHome'] != 0 && $this->validator->hasPages(1)) {
                $result = $this->resetHome();
            } else {
                unset($values['IsHome']);
            }

            if (empty($values['IsPublished']) || $values['IsPublished'] == $this->alPage->getIsPublished()) {
                unset($values['IsPublished']);
            }

            if ($result !== false) {
                if (!empty($values)) {
                    $result = $this->pageRepository
                                ->setRepositoryObject($this->alPage)
                                ->save($values);
                }

                if (false !== $result) {
                    $eventName = PageEvents::BEFORE_EDIT_PAGE_COMMIT;
                    $result = !$this->eventsHandler
                                        ->createEvent($eventName, '\RedKiteLabs\RedKiteCms\RedKiteCmsBundle\Core\Event\Content\Page\BeforeEditPageCommitEvent', array($this, $values))
                                        ->dispatch()
                                        ->getEvent($eventName)
                                        ->isAborted();
                }
            }

            if (false !== $result) {
                $this->pageRepository->commit();

                $this->eventsHandler
                     ->createEvent(PageEvents::AFTER_EDIT_PAGE, '\RedKiteLabs\RedKiteCms\RedKiteCmsBundle\Core\Event\Content\Page\AfterPageEditedEvent', array($this))
                     ->dispatch();

                return $result;
            }

            $this->pageRepository->rollBack();

            return $result;
        } catch (\Exception $e) {
            if (isset($this->pageRepository) && $this->pageRepository !== null) {
                $this->pageRepository->rollBack();
            }

            throw $e;
        }
    }
339683
public function setValues(array $values)
    {
        foreach ($this->type->getAttributes()->getKeys() as $attribute_name) {
            if (array_key_exists($attribute_name, $values)) {
                $this->setValue($attribute_name, $values[$attribute_name]);
            }
        }

        return $this->isValid();
    }