[ 'class' => LanguageBehavior::className(), 'objectLang' => OrderPaymentLang::className(), 'ownerKey' => 'id', 'langKey' => 'order_payment_id', ], ]; } /** * @inheritdoc */ public function rules() { return [ [ [ 'short' ], 'string', ], [ [ 'status' ], 'integer', ], [ [ 'status' ], 'default', 'value' => 1, ], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => \Yii::t('app', 'ID'), 'status' => \Yii::t('app', 'Статус'), 'short' => \Yii::t('app', 'Название'), ]; } /** * @return \yii\db\ActiveQuery */ public function getOrderPaymentLangs() { return $this->hasMany(OrderPaymentLang::className(), [ 'order_payment_id' => 'id' ]); } }