From 4e9f8bd5e5215e4c8da98c3ef509d1fa75ec2f96 Mon Sep 17 00:00:00 2001
From: Alexander Makarov <sam@rmcreative.ru>
Date: Tue, 26 Aug 2014 13:16:40 +0400
Subject: [PATCH] Fixed example of transactional operations in AR guide
---
docs/guide/db-active-record.md | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/docs/guide/db-active-record.md b/docs/guide/db-active-record.md
index 7d7f0e6..c9af514 100644
--- a/docs/guide/db-active-record.md
+++ b/docs/guide/db-active-record.md
@@ -969,12 +969,16 @@ as described in "transactions" section of "[Database basics](db-dao.md)". Anothe
```php
class Post extends \yii\db\ActiveRecord
{
- return [
- 'admin' => self::OP_INSERT,
- 'api' => self::OP_INSERT | self::OP_UPDATE | self::OP_DELETE,
- // the above is equivalent to the following:
- // 'api' => self::OP_ALL,
- ];
+ public function transactions()
+ {
+ return [
+ 'admin' => self::OP_INSERT,
+ 'api' => self::OP_INSERT | self::OP_UPDATE | self::OP_DELETE,
+ // the above is equivalent to the following:
+ // 'api' => self::OP_ALL,
+ ];
+ }
+}
```
In the above `admin` and `api` are model scenarios and constants starting with `OP_` are operations that should
--
libgit2 0.27.1