Full Table

-key-markcolorprice
5PeugeotRed1550
14PeugeotGreen1200
22PeugeotBlue1400
31CitroenRed2000
45CitroenYellow1800
52CitroenBrown1400
67NissanBrown1700
71NissanGreen1750
89NissanRed1500

Find (price > 1500)

-key-markcolorprice
5PeugeotRed1550
31CitroenRed2000
45CitroenYellow1800
67NissanBrown1700
71NissanGreen1750
$table->find(
    ConditionBuilder::createAnd()
        ->greaterThan('price', 1500)
);

Find (price > 1500 and color = "Red")

-key-markcolorprice
5PeugeotRed1550
31CitroenRed2000
$table->find(
    ConditionBuilder::createAnd()
        ->greaterThan('price', 1500)
        ->equalTo('color', 'Red')
);

Find (price > 1500 or color = "Red")

-key-markcolorprice
5PeugeotRed1550
31CitroenRed2000
45CitroenYellow1800
67NissanBrown1700
71NissanGreen1750
89NissanRed1500
$table->find(
    ConditionBuilder::createOr()
        ->greaterThan('price', 1500)
        ->equalTo('color', 'Red')
);

Find (price > 1500 or color = "Red") sorted (mark ASC then price DESC)

-key-markcolorprice
31CitroenRed2000
45CitroenYellow1800
71NissanGreen1750
67NissanBrown1700
89NissanRed1500
5PeugeotRed1550
$table->find(
    ConditionBuilder::createOr()
        ->greaterThan('price', 1500)
        ->equalTo('color', 'Red')
)
    ->sort([
        'mark' => true,
        'price' => false,
    ]);

Find (price > 1500 or color = "Red") sorted (mark ASC then price DESC) limit (1, 3)

-key-markcolorprice
45CitroenYellow1800
71NissanGreen1750
67NissanBrown1700
$table->find(
    ConditionBuilder::createOr()
        ->greaterThan('price', 1500)
        ->equalTo('color', 'Red')
)
    ->sort([
        'mark' => true,
        'price' => false,
    ])
    ->limit(1, 3);

Find (price > 1500 or color = "Red") sorted (mark ASC then price DESC) limit (1, 3) find (color match regexp /w/) sorted (price ASC)

-key-markcolorprice
67NissanBrown1700
45CitroenYellow1800
$table->find(
    ConditionBuilder::createOr()
        ->greaterThan('price', 1500)
        ->equalTo('color', 'Red')
)
    ->sort([
        'mark' => true,
        'price' => false,
    ])
    ->limit(1, 3)
    ->find(
        ConditionBuilder::createAnd()
            ->matchRegExp('color', 'w')
    )
    ->sort(['price' => true]);

Find ((price > 1600 and color = "Red") or (price < 1600 and color = "Green"))

-key-markcolorprice
14PeugeotGreen1200
31CitroenRed2000
$table->find(
    ConditionBuilder::createOr()
        ->add(ConditionBuilder::createAnd()
            ->greaterThan('price', 1600)
            ->equalTo('color', 'Red')
        )
        ->add(ConditionBuilder::createAnd()
            ->lowerThan('price', 1600)
            ->equalTo('color', 'Green')
        )
);

Find (-key- IN 52,31,89) sorted (price ASC)

-key-markcolorprice
52CitroenBrown1400
89NissanRed1500
31CitroenRed2000
$table->find(
    ConditionBuilder::createAnd()
        ->in(null, [52, 31, 89])
)
    ->sort([
        'price' => true,
    ]);