255], [['path'], 'string', 'max' => 5000], ]; } public function behaviors() { return [TimestampBehavior::class]; } public function attributeLabels() { return [ 'id' => \Yii::t('common', 'ID'), 'param' => \Yii::t('common', 'Параметр'), 'path' => \Yii::t('common', 'Путь'), 'checksum' => \Yii::t('common', 'Хеш-сумма'), 'status' => \Yii::t('common', 'Статус'), 'created_at' => \Yii::t('common', 'Создано'), 'updated_at' => \Yii::t('common', 'Обновлено'), ]; } public static function getCurrentVendorChecksum(): ?Checksum { return Checksum::find() ->andWhere(['param' => Checksum::PARAM_VENDOR]) ->orderBy(['updated_at' => 'DESC']) ->limit(1) ->one(); } public function getStatusDescription() { switch ($this->status) { case static::CALC_STATUS_PROCESSING: return \Yii::t('common', 'В обработке'); case static::CALC_STATUS_COMPLETED: return \Yii::t('common', 'Завершено'); default: return ''; } } }