Welcome Guest, Not a member yet? Register   Sign In
How use ModelObject->save($entityObject) well?
#4

In BaseModel ,This function is not a good idea. for resolved insert and update. 
PHP Code:
protected function doProtectFields(array $data): array
    {
        if (! $this->protectFields) {
            return $data;
        }

        if (empty($this->allowedFields)) {
            throw DataException::forInvalidAllowedFields(static::class);
        }

        foreach (array_keys($data) as $key) {
            if (! in_array($key$this->allowedFieldstrue)) {
                unset($data[$key]);
            }
        }

        return $data;
    
Reply


Messages In This Thread
RE: How use ModelObject->save($entityObject) well? - by cwwjsyc - 07-26-2022, 12:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB