Skip to content
Commit d4829afd authored by pandamiller's avatar pandamiller
Browse files

Fix Advanced Conditions samples which are wrong

The documented results of the following samples are (thankfully) wrong:

$query = $articles->find()
    ->where([
        'author_id' => 3,
        'OR' => ['author_id' => 2],
    ]);

Would actually create: SELECT * FROM articles WHERE (author_id = 2 AND author_id = 3)

$query = $articles->find()
        ->where(['author_id' => 2])
        ->orWhere(['author_id' => 3])
        ->andWhere([
            'published' => true,
            'view_count >' => 10
        ])
        ->orWhere(['promoted' => true]);

Would actually create: SELECT * FROM articles WHERE (promoted = true OR ((published = true AND view_count > 10) AND (author_id = 2 OR author_id = 3)))
parent 9a94968c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment