| Total Complexity | 4 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class Account extends \app\models\Account |
||
| 16 | { |
||
| 17 | public function behaviors() |
||
| 18 | { |
||
| 19 | return ArrayHelper::merge(parent::behaviors(), [ |
||
| 20 | 'type' => [ |
||
| 21 | 'class' => AttributeTypecastBehavior::class, |
||
| 22 | 'typecastAfterValidate' => false, |
||
| 23 | 'typecastAfterSave' => true, |
||
| 24 | 'typecastAfterFind' => true, |
||
| 25 | ], |
||
| 26 | ]); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function fields() |
||
| 30 | { |
||
| 31 | return [ |
||
| 32 | 'id', |
||
| 33 | 'uid', |
||
| 34 | 'username', |
||
| 35 | 'monitoring', |
||
| 36 | 'disabled', |
||
| 37 | 'name', |
||
| 38 | 'profile_pic_url' => function () { |
||
| 39 | return Url::to($this->profile_pic_url, true); |
||
| 40 | }, |
||
| 41 | 'full_name', |
||
| 42 | 'biography', |
||
| 43 | 'external_url', |
||
| 44 | 'instagram_id', |
||
| 45 | 'notes', |
||
| 46 | 'updated_at', |
||
| 47 | 'created_at', |
||
| 48 | |||
| 49 | // 'followed_by' => 'as_followed_by', |
||
| 50 | // 'follows' => 'as_follows', |
||
| 51 | // 'media' => 'as_media', |
||
| 52 | // 'er' => 'as_er', |
||
| 53 | ]; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function extraFields() |
||
| 57 | { |
||
| 58 | return [ |
||
| 59 | 'lastAccountStats', |
||
| 60 | ]; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return \yii\db\ActiveQuery |
||
| 65 | */ |
||
| 66 | public function getLastAccountStats() |
||
| 71 | } |
||
| 72 | } |