Skip to content

WriteQueries :: UpdateByWhere #57

@Pierozi

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;
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions