Skip to content

Model->find() crashes on conditions #37

@ipundit

Description

@ipundit

In Model.php:

/*

  • array<"conditions", array<string,string>>
    /
    public static function find(/
    $type, $options */)

crashes with this test case:

In ActiveRecordFindTest.php:

public function test_find_by_conditions()
{
    $author = Author::find(['conditions'=>["author_id = (?)", 3]]);
    $this->assertEquals(3, $author->id);
}

because 0 options after extracting ['conditions'] is treated as multiple rows when it should be treated as a single row.

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