Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Yii2 Dynamic Relational, Lazy loading

// SELECT * FROM `customer` LIMIT 100
$customers = Customer::find()->limit(100)->all();

foreach ($customers as $customer) {
    // SELECT * FROM `order` WHERE `customer_id` = ...
    $orders = $customer->orders;
}
Source by www.yiiframework.com #
 
PREVIOUS NEXT
Tagged: #Dynamic #Lazy #loading
ADD COMMENT
Topic
Name
6+9 =