[ 'class' => LanguageBehavior::className(), 'objectLang' => OrderDeliveryLang::className(), 'ownerKey' => 'id', 'langKey' => 'order_delivery_id', ], ]; } public static function tableName() { return 'order_delivery'; } public function rules() { return [ [ [ 'value', 'parent_id', 'sort', ], 'integer', ], ]; } /** * @return \yii\db\ActiveQuery */ public function getParent() { return $this->hasOne(self::className(), [ 'id' => 'parent_id' ]); } public function getChildren() { return $this->hasMany(self::className(), [ 'parent_id' => 'id' ]); } }