return [
'timestamp' => [
'class' => TimestampBehavior::class,
'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => [
'buy_at', 'stop_at',
],
],
'value' => new Expression('NOW()'),
],
];
return [
'timestamp_buy_at' => [
'class' => TimestampBehavior::class,
'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => [
'buy_at',
],
],
'value' => new Expression('NOW()'),
],
'timestamp_stop_at' => [
'class' => TimestampBehavior::class,
'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => [
'stop_at',
],
],
'value' => new Expression('NOW() + INTERVAL 30 DAY'),
],
];