fill data from array.

@param array $data

@return null
766910
protected function fill($data)
    {
        if ($this->_canKept && $this->keptAt($data['values'])) {
            $this->_kept = true;
        }
        if ($this->_canStashed && $this->stashedAt($data['values'])) {
            $this->_stashed = true;
        }
        //
        $this->convert($data['values']);
    }
916325
public function load($data)
    {
        // Turn current string into an array using provided separator
        $values = explode(',', $data);

        // If empty string is passed, then explode() returns false
        if ($values === false) {
            $values = array();
        } else {
            // Remove empty values from current array we have
            array_walk($values, function($value, $key) use (&$values) {
                if (empty($value)) {
                    unset($values[$key]);
                }
            });
        }

        // Done
        $this->values = $values;
    }
707625
public function populate($data = array())
    {
        if (isset($data['question']) && $data['question'] !== null) {
            $this->question = $data['question'];
        }

        if (isset($data['hint']) && $data['hint'] !== null) {
            $this->hint = $data['hint'];
        }

        if (isset($data['jsonData']) && $data['jsonData'] !== null) {
            $this->jsonData = $data['jsonData'];
        }

        if (isset($data['type']) && $data['type'] !== null) {
            $this->type = $data['type'];
        }

        if (isset($data['position']) && $data['position'] !== null) {
            $this->position = $data['position'];
        }

        if (isset($data['weight']) && $data['weight'] !== null) {
            $this->weight = $data['weight'];
        }

        if (isset($data['image']) && $data['image'] !== null) {
            $this->image = $data['image'];
        }

        if (isset($data['video']) && $data['video'] !== null) {
            $this->video = $data['video'];
        }

        if (isset($data['audio']) && $data['audio'] !== null) {
            $this->audio = $data['audio'];
        }

        if (isset($data['autoplay']) && $data['autoplay'] !== null) {
            $this->autoplay = $data['autoplay'];
        }

        if (isset($data['timer']) && $data['timer'] !== null) {
            $this->timer = $data['timer'];
        }

        if (isset($data['timer_duration']) && $data['timer_duration'] !== null) {
            $this->timer_duration = $data['timer_duration'];
        }

        if (isset($data['max_points']) && $data['max_points'] !== null) {
            $this->max_points = $data['max_points'];
        }

        if (isset($data['max_correct_answers']) && $data['max_correct_answers'] !== null) {
            $this->max_correct_answers = $data['max_correct_answers'];
        }
    }
454917
public static function fromArray(array $data)
    {
        $iniSections = IniParser::i()->parseArray($data);

        return self::fromIniSections($iniSections);
    }
945827
protected function cleanup(array &$data)
    {
        foreach ($data as &$value) {
            if (\is_array($value)) {
                $this->cleanup($value);
            }
        }

        $data = array_filter($data, function ($value) {
            return null !== $value;
        });
    }
54297
public function populate($data = array())
    {
        parent::populate($data);

        if (isset($data['drawAuto']) && $data['drawAuto'] !== null) {
            $this->drawAuto = $data['drawAuto'];
        }
        $this->drawDate = (isset($data['drawDate']) && $data['drawDate'] !== null) ?
            \DateTime::createFromFormat('d/m/Y', $data['drawDate']) :
            null;
    }
913438
private function populateWith(array $data): array
    {
        $newData = [];
        foreach ($data as $row) {
            $tmp = [];
            foreach ($row as $key => $value) {
                if (false !== strpos($key, '__')) {
                    list($prefix, $postfix) = explode('__', $key);
                    if (!isset($tmp[$prefix])) {
                        $tmp[$prefix] = [];
                    }
                    $tmp[$prefix][$postfix] = $value;
                } else {
                    $tmp[$key] = $value;
                }
            }
            $newData[] = $tmp;
        }

        return $newData;
    }
307014
public function setData(array $data)
    {
        $this->data = $this->parseData($data);

        $this->setRules($this->initialRules);

        return $this;
    }
529576
public function fillFromArray(array $data)
	{
		$data = $data + array(
				'style' 		=> null,
				'align' 		=> null,
				'alternate_text' 	=> null,
				'title' 		=> null,
				'description' 	=> null,

				'size_width' 	=> null,
				'size_name' 	=> null,
				'crop_top' 		=> null,
				'crop_left' 	=> null,
				'crop_width' 	=> null,
				'crop_height' 	=> null,

				'size_height' 	=> null,
			);

		$this->imageId = $data['id'];
		$this->align = $data['align'];
		$this->style = $data['style'];
		$this->alternateText = $data['alternate_text'];
		$this->title = $data['title'];
		$this->description = $data['description'];

		$this->sizeName = $data['size_name'];

		$this->setWidth($data['size_width']);
		$this->setHeight($data['size_height']);
		$this->setCropTop($data['crop_top']);
		$this->setCropLeft($data['crop_left']);
		$this->setCropWidth($data['crop_width']);
		$this->setCropHeight($data['crop_height']);
	}
412637
public function populate($data = array())
    {
        if (isset($data['name']) && $data['name'] !== null) {
            $this->name = $data['name'];
        }
        if (isset($data['code']) && $data['code'] !== null) {
            $this->code = $data['code'];
        }
        if (isset($data['phase']) && $data['phase'] !== null) {
            $this->phase = $data['phase'];
        }
        if (isset($data['active']) && $data['active'] !== null) {
            $this->active = $data['active'];
        }
    }
567522
public function populate($data = array())
    {
        parent::populate($data);

        if (isset($data['winners']) && $data['winners'] !== null) {
            $this->winners = $data['winners'];
        }

        if (isset($data['timer']) && $data['timer'] !== null) {
            $this->timer = $data['timer'];
        }
        if (isset($data['timerDuration']) && $data['timerDuration'] !== null) {
            $this->timerDuration = $data['timerDuration'];
        }
        if (isset($data['questionGrouping']) && $data['questionGrouping'] !== null) {
            $this->questionGrouping = $data['questionGrouping'];
        }

        if (isset($data['maxPoints']) && $data['maxPoints'] !== null) {
            $this->maxPoints = $data['maxPoints'];
        }

        if (isset($data['maxCorrectAnswers']) && $data['maxCorrectAnswers'] !== null) {
            $this->maxCorrectAnswers = $data['maxCorrectAnswers'];
        }

        if (isset($data['displayGoodAnswers']) && $data['displayGoodAnswers'] !== null) {
            $this->displayGoodAnswers = $data['displayGoodAnswers'];
        }

        if (isset($data['displayStats']) && $data['displayStats'] !== null) {
            $this->displayStats = $data['displayStats'];
        }
    }
303475
public function fill(array $data)
    {
        /* @var Field $field */
        foreach ($this->fields() as $field) {
            $field->fill($data);
        }

        return $this;
    }
1036680
public function setData(array $data)
    {
        foreach ($data as $key => $val) {
            $setter = $this->setter($key);
            if (is_callable([ $this, $setter ])) {
                $this->{$setter}($val);
            } else {
                $this->{$key} = $val;
            }
        }

        return $this;
    }
183322
public function populate($data = array())
    {
        $this->appId = (isset($data['appId'])) ? $data['appId'] : null;
        $this->appSecret = (isset($data['appSecret'])) ? $data['appSecret'] : null;

    }
1241710
public function populate($data = array())
    {
        if (isset($data['partner']) && $data['partner'] !== null) {
            $this->partner = $data['partner'];
        }

        $this->title = (isset($data['title'])) ? $data['title'] : null;
        $this->type = (isset($data['type']) && $data['type'] !== null) ? $data['type'] : null;

        if (isset($data['mainImage']) && $data['mainImage'] !== null) {
            $this->mainImage = $data['mainImage'];
        }

        if (isset($data['secondImage']) && $data['secondImage'] !== null) {
            $this->secondImage = $data['secondImage'];
        }

        if (isset($data['active']) && $data['active'] !== null) {
            $this->active = $data['active'];
        }

        $this->layout           = (isset($data['layout'])) ? $data['layout'] : null;
        $this->stylesheet       = (isset($data['stylesheet'])) ? $data['stylesheet'] : null;

        $this->pushHome         = (isset($data['pushHome']) && $data['pushHome'] !== null) ? $data['pushHome'] : 0;
        $this->displayHome      = (isset($data['displayHome']) && $data['displayHome'] !== null) ?
            $data['displayHome'] :
            0;
        $this->prizeCategory   = (isset($data['prizeCategory'])) ? $data['prizeCategory'] : null;

        $this->publicationDate  = (isset($data['publicationDate']) && $data['publicationDate'] !== null) ?
            DateTime::createFromFormat('d/m/Y', $data['publicationDate']) :
            null;
        $this->endDate         = (isset($data['endDate']) && $data['endDate'] !== null) ?
            DateTime::createFromFormat('d/m/Y', $data['endDate']) :
            null;
        $this->startDate       = (isset($data['startDate']) && $data['startDate'] !== null) ?
            DateTime::createFromFormat('d/m/Y', $data['startDate']) :
            null;

        $this->identifier       = (isset($data['identifier'])) ? $data['identifier'] : null;
        $this->welcomeBlock    = (isset($data['welcomeBlock'])) ? $data['welcomeBlock'] : null;
        $this->termsBlock       = (isset($data['termsBlock'])) ? $data['termsBlock'] : null;
        $this->conditionsBlock  = (isset($data['conditionsBlock'])) ? $data['conditionsBlock'] : null;

        $this->fbShareDescription   = (isset($data['fbShareDescription'])) ? $data['fbShareDescription'] : null;
        $this->fbShareImage     = (isset($data['fbShareImage'])) ? $data['fbShareImage'] : null;
        $this->fbRequestMessage = (isset($data['fbRequestMessage'])) ? $data['fbRequestMessage'] : null;
        $this->twShareMessage   = (isset($data['twShareMessage'])) ? $data['twShareMessage'] : null;
        $this->emailSubjectMessage   = (isset($data['emailSubjectMessage'])) ? $data['emailSubjectMessage'] : null;
        $this->emailShareMessage   = (isset($data['emailShareMessage'])) ? $data['emailShareMessage'] : null;
    }
1374919
public function populate($data = array())
    {
        if (isset($data['name']) && $data['name'] !== null) {
            $this->name = $data['name'];
        }

        if (isset($data['type']) && $data['type'] !== null) {
            $this->type = $data['type'];
        }
    }
1215989
public function populate($data = array())
    {
        $this->value = (isset($data['value']) && $data['value'] !== null) ? $data['value'] : null;
        $this->active = (isset($data['active']) && $data['active'] !== null) ? $data['active'] : null;
        $this->winning = (isset($data['winning']) && $data['winning'] !== null) ? $data['winning'] : null;
    }