public function setFieldData($field, $data)
    {
        if (is_array($this->data)) {
            $this->data[$field] = $data;
        } else {
            $this->data->$field = $data;
        }
        return $this;
    }
public function setFieldData($field, $data)
    {
        if (is_array($this->data)) {
            $this->data[$field] = $data;
        } else {
            $this->data->$field = $data;
        }
        return $this;
    }
public function setFieldData ( $ field , $ data ) { if ( is_array ( $ this -> data ) ) { $ this -> data [ $ field ] = $ data ; } else { $ this -> data -> $ field = $ data ; } return $ this ; }
Sets data for validation field

@param string $field The name of field
@param mixed $data The data of field
@return $this
Sets data for validation field