Handle editable update.

@param array $input

@return array
329010
protected function handleEditable(array $input = [])
    {
        if (array_key_exists('_editable', $input)) {
            $name = $input['name'];
            $value = $input['value'];

            Arr::forget($input, ['pk', 'value', 'name']);
            Arr::set($input, $name, $value);
        }

        return $input;
    }
1058542
protected function parseTable($input)
    {
        $input = (array) $input;

        return array_map(function ($key, $value) {
            $bytes = ['used_memory', 'free_memory', 'wasted_memory', 'buffer_size'];
            $times = ['start_time', 'last_restart_time'];

            if (in_array($key, $bytes)) {
                $value = number_format($value / 1048576, 2).' MB';
            } elseif (in_array($key, $times)) {
                $value = date('Y-m-d H:i:s', $value);
            }

            return [
                'key'       => $key,
                'value'     => $value,
            ];
        }, array_keys($input), $input);
    }
281596
protected function handleFileSort(array $input = [])
    {
        if (!array_key_exists(Field::FILE_SORT_FLAG, $input)) {
            return $input;
        }

        $sorts = array_filter($input[Field::FILE_SORT_FLAG]);

        if (empty($sorts)) {
            return $input;
        }

        foreach ($sorts as $column => $order) {
            $input[$column] = $order;
        }

        request()->replace($input);

        return $input;
    }
1035784
public function sanitizeInput(array $input)
    {
        return $input = collect($input)->reject(function ($value) {
            return is_null($value) || empty($value);
        })->toArray();
    }
544007
protected function fillArrayInput(array $input, $default = 0)
    {
        if (empty($input)) {
            return [];
        }

        $res = array_fill($default, max(array_keys($input)), null);

        foreach ($input as $index => $value) {
            $res[$index] = $value;
        }

        return $res;
    }
997147
public function prepare($input)
    {
        foreach ($input as $key => $record) {
            $this->setFieldOriginalValue($key);
            $input[$key] = $this->prepareValue($key, $record);
        }

        return $input;
    }
68586
public function keyToValue(array $input)
    {
        $output = array();

        foreach ($input as $key => $value) {
            $output[] = array($key, $value);
        }

        return $output;
    }
1066741
private function processPageParams(array $input)
    {
        if (!empty($input['page']) && is_numeric($input['page'])) {
            $this->page = $input['page'];
        }
        if (!empty($input['per_page']) && is_numeric($input['per_page'])) {
            $this->perPage = $input['per_page'];
        }
        return $input;
    }
562421
public function update(array $input)
  {
    unset($input['_token']);
    $input = eloquent_array_filter_for_update($input);
    // $input['date'] = $this->Carbon->createFromFormat($this->Lang->get('form.phpShortDateFormat'), $input['date'])->format('Y-m-d');

    $this->DB->transaction(function() use (&$input)
    {
      $VoucherType = $this->VoucherType->byId($input['id']);
      $unchangedVoucherTypeValues = $VoucherType->toArray();

      $this->VoucherType->update($input, $VoucherType);

      $diff = 0;

      foreach ($input as $key => $value)
      {
        if($unchangedVoucherTypeValues[$key] != $value)
        {
          $diff++;

          if($diff == 1)
          {
            $Journal = $this->Journal->create(array('journalized_id' => $VoucherType->id, 'journalized_type' => $this->VoucherType->getTable(), 'user_id' => $this->AuthenticationManager->getLoggedUserId(), 'organization_id' => $this->AuthenticationManager->getCurrentUserOrganizationId()));
          }

          if($key == 'name')
          {
            $this->Journal->attachDetail($Journal->id, array('field' => $this->Lang->get('decima-accounting::voucher-type-management.name'), 'field_lang_key' => 'decima-accounting::voucher-type-management.name', 'old_value' => $this->Lang->get($unchangedVoucherTypeValues[$key]), 'new_value' => $this->Lang->get($value)), $Journal);
          }
          else
          {
            $this->Journal->attachDetail($Journal->id, array('field' => $this->Lang->get('decima-accounting::voucher-type-management.' . camel_case($key)), 'field_lang_key' => 'decima-accounting::voucher-type-management.' . camel_case($key), 'old_value' => $unchangedVoucherTypeValues[$key], 'new_value' => $value), $Journal);
          }
        }
      }
    });

    return json_encode(array('success' => $this->Lang->get('form.defaultSuccessUpdateMessage')));
  }
1110234
public function markDeleted(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_MARK_DELETED] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
200311
public function update(Model $model, array $input)
    {
        $updated = $model->update($input);

        if ($updated) {
            app('cache')->flush();
        }

        return $updated;
    }
91420
public function readyToPost(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_READY_TO_POST] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
71500
public function save(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		// we must set entry method
		if (isset($this->form->form_object->collection_object->primary_model->column_prefix)) {
			$input[$this->form->form_object->collection_object->primary_model->column_prefix . 'entry_method'] = 'G';
		}
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
876760
public function updateOrCreate(array $input)
    {
        $this->cache->tags($this->getModel())->flush();
        return $this->repository->updateOrCreate($input);
    }
1024386
public function process(array $input)
    {
        try
        {
            $success = $this->v->validate($input);
        }
        catch(ValidationException $e)
        {
            $this->setErrorsAndThrowException();
        }
        if( ! $success)
        {
            $this->setErrorsAndThrowException();
        }

        Event::fire("form.processing", array($input));
        return $this->callRepository($input);
    }
103626
protected function normalize(array $input) : array
    {
        $normalized = [];
        foreach ($this->rules() as $field => $value) {
            $normalized[$field] = $input[$field] ?? '';
        }
        return $normalized;
    }
796964
public function validate(array $input = []): ValidationResult
    {
        $results = [];

        foreach ($this->rules as $key => $definition) {

            $rules = $this->parser->parseRulesDefinition($definition);

            $results[$key] = $rules->validate($key, $input);

        }

        return new ValidationResult($results, $this->translator);
    }