Entity::prepareInputForUpdate PHP Method

prepareInputForUpdate() public method

public prepareInputForUpdate ( $input )
    function prepareInputForUpdate($input)
    {
        $input = parent::prepareInputForUpdate($input);
        // Si on change le taux de déclenchement de l'enquête (enquête activée) ou le type de l'enquete,
        // cela s'applique aux prochains tickets - Pas à l'historique
        if (isset($input['inquest_rate']) && ($this->fields['inquest_rate'] == 0 || is_null($this->fields['max_closedate'])) && $input['inquest_rate'] != $this->fields['inquest_rate'] || isset($input['inquest_config']) && ($this->fields['inquest_config'] == self::CONFIG_PARENT || is_null($this->fields['max_closedate'])) && $input['inquest_config'] != $this->fields['inquest_config']) {
            $input['max_closedate'] = $_SESSION["glpi_currenttime"];
        }
        // Force entities_id = -1 for root entity
        if ($input['id'] == 0) {
            $input['entities_id'] = -1;
            $input['level'] = 1;
        }
        if (!Session::isCron()) {
            // Filter input for connected
            $input = $this->checkRightDatas($input);
        }
        return $input;
    }