@@ -62,7 +62,7 @@ public function asArray(bool|null $value = true): static;
6262 *
6363 * ```php
6464 * // Create active query
65- * CustomerQuery = new ActiveQuery( Customer::class );
65+ * CustomerQuery = Customer::query( );
6666 * // find customers together with their orders and country
6767 * CustomerQuery->with('orders', 'country')->all();
6868 * // find customers together with their orders and the orders' shipping address
@@ -151,19 +151,19 @@ public function buildJoinWith(): void;
151151 *
152152 * ```php
153153 * // Find all orders that contain books, and eager loading "books".
154- * $orderQuery = new ActiveQuery( Order::class );
154+ * $orderQuery = Order::query( );
155155 * $orderQuery->joinWith('books', true, 'INNER JOIN')->all();
156156 *
157157 * // Find all orders, eagerly load "books", and sort the orders and books by the book names.
158- * $orderQuery = new ActiveQuery( Order::class, $db );
158+ * $orderQuery = Order::query( );
159159 * $orderQuery->joinWith([
160160 * 'books' => function (ActiveQuery $query) {
161161 * $query->orderBy('item.name');
162162 * }
163163 * ])->all();
164164 *
165165 * // Find all orders that contain books of the category 'Science fiction', using the alias "b" for the book table.
166- * $order = new ActiveQuery( Order::class, $db );
166+ * $order = Order::query( );
167167 * $orderQuery->joinWith(['books b'], true, 'INNER JOIN')->where(['b.category' => 'Science fiction'])->all();
168168 * ```
169169 * @param array|bool $eagerLoading Whether to eager load the relations specified in `$with`. When this is boolean.
@@ -353,7 +353,7 @@ public function relatedRecords(): ActiveRecordInterface|array|null;
353353 * In the examples below, the `id` column is the primary key of the table.
354354 *
355355 * ```php
356- * $customerQuery = new ActiveQuery( Customer::class );
356+ * $customerQuery = Customer::query( );
357357 *
358358 * $customer = $customerQuery->findByPk(1); // WHERE id = 1
359359 * ```
@@ -365,7 +365,7 @@ public function relatedRecords(): ActiveRecordInterface|array|null;
365365 * In the examples below, the `id` and `id2` columns are the composite primary key of the table.
366366 *
367367 * ```php
368- * $orderItemQuery = new ActiveQuery( OrderItem::class );
368+ * $orderItemQuery = OrderItem::query( );
369369 *
370370 * $orderItem = $orderItemQuery->findByPk([1, 2]); // WHERE id = 1 AND id2 = 2
371371 * ```
@@ -378,7 +378,7 @@ public function relatedRecords(): ActiveRecordInterface|array|null;
378378 * {
379379 * $id = (string) $request->getAttribute('id');
380380 *
381- * $customerQuery = new ActiveQuery( Customer::class );
381+ * $customerQuery = Customer::query( );
382382 * $customer = $customerQuery->findByPk($id);
383383 * }
384384 * ```
0 commit comments