Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Allow Invokable Objects For $where parameters in AbstractTableGateway #270

@baileylo

Description

@baileylo

Currently, the $where parameter in AbstractTableGateway::select, AbstractTableGateway::update, and AbstractTableGateway::delete will accept Closures, but not invokable classes. It would be nice if it were possible expand the allowed parameters types to include invokable classes.

The following code should allow it. I was hoping to replace with is_callable($where), but that would return true for cases where $where couldn't be executed using $where($select);, e..g [ new\DateTime, 'format'].

if ($where instanceof \Closure || (is_object($where) && is_callable($where))) {
    $where($select);
} elseif ($where !== null) {
    $select->where($where);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions