Welcome Guest, Not a member yet? Register   Sign In
CI4.0rc3 + calling model->save() on unchanged entity causes critical error
#3

This is a solution from the Basic App CMS. Add this code to model class.

PHP Code:
    /**
     * When I save the model without changes i get an error: "You must use the "set" method to update an entry."
     * To fix this I change the $onlyChanged default value from "true" to "false".
     *
     * ToDo: Remove this later...  
     */
    public static function classToArray($data$primaryKey nullstring $dateFormat 'datetime'bool $onlyChanged false) : array 
    {
        return parent::classToArray($data$primaryKey$dateFormat$onlyChanged);
    

Basic App, an open source simple CMS based on CodeIgniter 4
Reply


Messages In This Thread
RE: CI4.0rc3 + calling model->save() on unchanged entity causes critical error - by Basic App - 11-28-2019, 04:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB