models/base/AcPeriodBalanceDim.php
<?php
// This class was automatically generated by a giiant build task
// You should not change it manually as it will be overwritten on next build
namespace d3acc\models\base;
use Yii;
/**
* This is the base-model class for table "ac_period_balance_dim".
*
* @property integer $id
* @property integer $sys_company_id
* @property integer $period_id
* @property integer $dim_id
* @property string $amount
* @property integer $account_id
*
* @property \d3acc\models\AcAccount $account
* @property \d3acc\models\AcDim $dim
* @property \d3acc\models\AcPeriod $period
* @property string $aliasModel
*/
abstract class AcPeriodBalanceDim extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName(): string
{
return 'ac_period_balance_dim';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
'required' => [['period_id', 'dim_id', 'amount', 'account_id'], 'required'],
'smallint Unsigned' => [['sys_company_id','period_id','dim_id','account_id'],'integer' ,'min' => 0 ,'max' => 65535],
'integer Unsigned' => [['id'],'integer' ,'min' => 0 ,'max' => 4294967295],
[['amount'], 'number'],
[['account_id'], 'exist', 'skipOnError' => true, 'targetClass' => \d3acc\models\AcAccount::className(), 'targetAttribute' => ['account_id' => 'id']],
[['dim_id'], 'exist', 'skipOnError' => true, 'targetClass' => \d3acc\models\AcDim::className(), 'targetAttribute' => ['dim_id' => 'id']],
[['period_id'], 'exist', 'skipOnError' => true, 'targetClass' => \d3acc\models\AcPeriod::className(), 'targetAttribute' => ['period_id' => 'id']]
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => Yii::t('d3acc', 'ID'),
'sys_company_id' => Yii::t('d3acc', 'Sys Company ID'),
'period_id' => Yii::t('d3acc', 'Period'),
'dim_id' => Yii::t('d3acc', 'Dimension'),
'amount' => Yii::t('d3acc', 'Amount'),
'account_id' => Yii::t('d3acc', 'Account'),
];
}
/**
* @inheritdoc
*/
public function attributeHints(): array
{
return array_merge(parent::attributeHints(), [
'period_id' => Yii::t('d3acc', 'Period'),
'dim_id' => Yii::t('d3acc', 'Dimension'),
'amount' => Yii::t('d3acc', 'Amount'),
'account_id' => Yii::t('d3acc', 'Account'),
]);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getAccount()
{
return $this->hasOne(\d3acc\models\AcAccount::className(), ['id' => 'account_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getDim()
{
return $this->hasOne(\d3acc\models\AcDim::className(), ['id' => 'dim_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getPeriod()
{
return $this->hasOne(\d3acc\models\AcPeriod::className(), ['id' => 'period_id']);
}
}