0
0

More than 1 year has passed since last update.

【cakephp】 [->eq]こういう時のやつ

Last updated at Posted at 2022-10-14

調べていて、パッと出てこなかったのでまとめます。

こういう時のやつ↓

$query = $articles->find()
    ->where(function (QueryExpression $exp) {
        return $exp
            ->eq('author_id', 2)
            ->eq('published', true)
            ->notEq('spam', true)
            ->gt('view_count', 10);
    });

ソース引用:https://book.cakephp.org/3/ja/orm/query-builder.html

一覧

演算子 意味 英語 一般的な記号
eq 等しい equal =, ==
notEq 等しくない not equal <>, !=
gt より大きい greater than >
ge 以上 greater than or equal >=
lt より小さい less than <
le 以下 less than or equal <=

まとまってる比較演算子のサイトのテーブルを引用しました。
引用:https://step-learn.com/article/powershell/011-operator-compare.html

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0