Commit e4963f50 by Alexander Kochetov

Guide updated

parent 7d157abd
...@@ -413,7 +413,7 @@ and you may also join with sub-relations. For example, ...@@ -413,7 +413,7 @@ and you may also join with sub-relations. For example,
$orders = Order::find()->innerJoinWith([ $orders = Order::find()->innerJoinWith([
'books', 'books',
'customer' => function ($query) { 'customer' => function ($query) {
$query->where('tbl_customer.create_time > ' . (time() - 24 * 3600)); $query->where('tbl_customer.created_at > ' . (time() - 24 * 3600));
} }
])->all(); ])->all();
// join with sub-relations: join with books and books' authors // join with sub-relations: join with books and books' authors
......
...@@ -23,8 +23,8 @@ class User extends ActiveRecord ...@@ -23,8 +23,8 @@ class User extends ActiveRecord
'timestamp' => [ 'timestamp' => [
'class' => 'yii\behaviors\AutoTimestamp', 'class' => 'yii\behaviors\AutoTimestamp',
'attributes' => [ 'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => ['create_time', 'update_time'], ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
ActiveRecord::EVENT_BEFORE_UPDATE => 'update_time', ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at',
], ],
], ],
]; ];
......
...@@ -238,7 +238,7 @@ Using the same `attributes` property you can massively assign data from associat ...@@ -238,7 +238,7 @@ Using the same `attributes` property you can massively assign data from associat
```php ```php
$attributes = [ $attributes = [
'title' => 'Model attributes', 'title' => 'Model attributes',
'create_time' => time(), 'created_at' => time(),
]; ];
$post->attributes = $attributes; $post->attributes = $attributes;
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment