Apply assignment rule.
@param array $data
@return bool|null|Rule
425330
protected function applyRule(array $data)
    {
        if (!($class = ArrayHelper::get($data, 'class')) || !(class_exists($class))) {
            return false;
        }
        $rule = new $class;
        if (!$rule instanceof Rule) {
            return false;
        }
        if ($ruleExist = $this->authManager->getRule($rule->name)) {
            return $ruleExist;
        }
        if ($this->authManager->add($rule)) {
            return $rule;
        }
        return false;
    }
575684
private function __applyValidationRules($data)
    {
        $rule = $this->get('validator');

        return ($rule ? General::validateString($data, $rule) : true);
    }
193720
public function setData(array $data)
    {
        $this->data = $data;
        
        // Force recreation of collections and properties.
        $this->educations = null;
        $this->employments = null;
        $this->link = null;
        
        return $this;
    }
907000
public function bind(array $data)
    {
        foreach ($data as $property => $value) {
            if ($this->has($property)) {
                $this->$property = $value;
            }
        }
    }
414629
public function update(array $data)
    {
        $todo = Basecamp::todos($this->bucket->id)->update($this->id, $data);

        $this->setAttributes($todo);

        return $todo;
    }
222343
public function inputCompile(array $data)
    {
        foreach ($data['policies'] as $rule => $policy) {
            $passed = call_user_func_array([new InputRules(), $rule], [$data['value']]);
            if ($passed !== true) {
                Handler::set(
                    str_replace(':field', $data['field'], $this->messages[$rule]), $data['field']);
            }
        }
    }
246773
protected function setRequestData(array $data = [])
    {
        if (($this->post instanceof Collection) && (!$this->post->isEmpty())) {
            unset($this->post);
        }

        $this->post = new Collection($data);

        return $this->post;
    }
1069423
private function setValues(array $data)
    {
        foreach ($data as $key => $datum) {
            $this->set($key, $datum);
        }
        return $this;
    }
97706
public function set(array $data)
    {
        $result = null;
        $this->hook->attach('rating.set.before', $data, $result, $this);

        if (isset($result)) {
            return $result;
        }

        $conditions = array(
            'user_id' => $data['user_id'],
            'product_id' => $data['product_id']
        );

        $this->db->delete('rating_user', $conditions);

        $this->addByUser($data);

        $result = $this->setBayesian($data);
        $this->hook->attach('rating.set.after', $data, $result, $this);
        return $result;
    }
701571
public function replace(array $data)
    {
        $data = &$this->loadFilterData($data);
        if ( $data == false ) {
            return false;
        }
        if ( !isset($data[$this->primaryKey]) && $this->autoPrimary ) {
            $data[$this->primaryKey] = StringUtils::genGlobalUid();
        }
        $result = $this->db->replace($this->table, $data);

        return $result;
    }
1004504
public function _assign( $data ) 
	{
		$data = $this->_before_assign( $data );

		$types = static::_model( 'types' );

		foreach( $data as $key => $value ) 
		{
			if ( array_key_exists( $key, $this->_data_store ) ) 
			{	
				// do we have to to something with the data type?
				if ( array_key_exists( $key, $types ) )
				{
					$value = $this->_type_assignment_get( $types[$key], $value );
				}

				$this->_data_store[$key] = $value;
			}
		}

		return $this;
	}
978130
private function setProperties(array $data)
    {
        foreach ($data as $key => $value) {
            $this->setProperty($key, $value);
        }

        return $this;
    }
493043
protected function createFilter(array $data = null)
    {
        $filter = new static();
        if ($data !== null) {
            $filter->setData($data);
        }
        return $filter;
    }
469557
public function fill(array $data)
    {
        if (isset($data['failures'])) {
            $this->failures = $data['failures'];
        }

        if (isset($data['rules'])) {
            $this->setRules($data['rules']);
        }

        if (isset($data['validator_class'])) {
            $this->setValidatorClass($data['validator_class']);
        }

        return $this;
    }
701206
public function setOldAttribute($data = null) {
        if (is_null($data)) {
            $data = $this->getAttribute();
        }
        $this->isNewRecord = false;
        $this->__oldAttributes = array_merge($this->__oldAttributes, $data);
        return $this;
    }
731915
public function strict_assign( array $fields, array $data )
	{
		foreach( $fields as $field )
		{
			if ( isset( $data[$field] ) )
			{
				$this->__set( $field, $data[$field] );
			}
		}
	}
26762
public static function setDataAttributes($data)
    {
        if(is_array($data) && count($data) > 0)
        {
            $keys = array_keys($data);

            $response = '';
            foreach($keys as $key)
            {
                $response .= ' data-' . $key . '="' . $data[$key] . '"';
            }

            return $response;
        }

        return null;
    }