Skip to content

WriteQueries :: UpdateByWhere #57

Description

@Pierozi

Hello, i don't know if this idea has been already discussed,
but i think that could be helpful to have an method updateByWhere.

I've done this method for me

    public function updateByWhere(Where $where, Array $params) {

        $entities = $this->findWhere($where);

        foreach ($entities as $entity) {

            foreach ($params as $key => $value) {
                $entity->$key = $value;
            }

            $this->updateOne($entity, array_keys($params));
        }

        return $entities;
    }

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions