Code

< 40 %
40-60 %
> 60 %
1
<?php
2
3
/**
4
 *  _   __ __ _____ _____ ___  ____  _____
5
 * | | / // // ___//_  _//   ||  __||_   _|
6
 * | |/ // /(__  )  / / / /| || |     | |
7
 * |___//_//____/  /_/ /_/ |_||_|     |_|
8
 * @link https://vistart.me/
9
 * @copyright Copyright (c) 2016 - 2017 vistart
10
 * @license https://vistart.me/license/
11
 */
12
13
namespace rhosocial\organization;
14
15
use Yii;
16
17
/**
18
 * @version 1.0
19
 * @author vistart <[email protected]>
20
 */
21
class Profile extends \rhosocial\user\Profile
22
{
23
    public $hostClass = Organization::class;
24
    public $contentAttribute = 'name';
25
    public $descriptionAttribute = 'description';
26
    public $cacheTagPrefix = 'tag_organization_profile_';
27
28 1
    public function attributeLabels()
29
    {
30
        return [
31 1
            $this->guidAttribute => Yii::t('user', 'GUID'),
32 1
            'name' => Yii::t('organization', 'Name'),
33 1
            'gravatar_type' => Yii::t('user', 'Gravatar Type'),
34 1
            'gravatar' => Yii::t('user', 'Gravatar'),
35 1
            'timezone' => Yii::t('user', 'Timezone'),
36 1
            $this->descriptionAttribute => Yii::t('organization', 'Description'),
37 1
            $this->createdAtAttribute => Yii::t('user', 'Creation Time'),
38 1
            $this->updatedAtAttribute => Yii::t('user', 'Last Updated Time'),
39
        ];
40
    }
41
42 51
    public function getIndividualSignRules()
43
    {
44 51
        return [];
45
    }
46
47 51
    public function getGenderRules()
48
    {
49 51
        return [];
50
    }
51
52 51
    public function getNameRules()
53
    {
54 51
        return [];
55
    }
56
57
    /**
58
     * @inheritdoc
59
     */
60 51
    public static function tableName()
61
    {
62 51
        return '{{%organization_profile}}';
63
    }
64
65 51
    public function scenarios()
66
    {
67 51
        $scenarios = parent::scenarios();
68 51
        $scenarios[self::SCENARIO_UPDATE] = [
69 51
            $this->contentAttribute, 'name', 'gravatar_type', 'gravatar', 'timezone', $this->descriptionAttribute,
70
        ];
71 51
        return $scenarios;
72
    }
73
}
74