Skip to content

bug found in Model.php #7

Description

@fer-g3

Hi
I found an error in Model.php class.
public function save($dados) { if (!isset($this->pk)) { $this->pk = 'id'; } if (isset($dados[$this->pk])) { **$this->find([$this->pk => $dados[$this->pk]]);** var_dump($this->count); exit; if ($this->count > 0) { $this->update($dados); } else { $this->create($dados); } } }
The Save method always asign 1 into count variable after you saved one record into database, which cause you can't save any other record because it enters in update statement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions