Answer the question
In order to leave comments, you need to log in
Bitrix ORM related fields not working?
There is a self-written ORM. There is a "product" on the page and inside the "calendar" page where you can add different time points.
When choosing a time point and saving, the changed values of the "product" and "calendar" are saved in the database through the associated table separately for the calendar
. But for some reason, the "calendar" values are not saved in the database. Item values are saved.
Description of the "product" column
class GameModeTable extends DataManager {
public static function getMap(){
return [
new IntegerField('ID',[
'primary' => true,
'autocomplete' => true
]),
new BooleanField('CUSTOM_SCHEDULE_SELECT'),
(new OneToMany('CUSTOM_SCHEDULES', CustomScheduleTable::class, 'GAMEMODE'))->configureJoinType('left'),
];
}
}
class CustomScheduleTable extends DataManager {
public static function getMap(){
return [
new IntegerField('ID',[
'primary' => true,
'autocomplete' => true
]),
(new IntegerField('GAMEMODE_ID'))->configurePrimary(true),
(new Reference(
'GAMEMODE',
GameModeTable::class,
Join::on('this.GAMEMODE_ID', 'ref.
ID')
))->configureJoinType('inner'),
(new IntegerField('DAY_NUMBER'))->configurePrimary(true),
(new IntegerField('TIME'))->configurePrimary(true),
(new DatetimeField('DATE'))->configurePrimary(true),
(new IntegerField('UNIQ'))->configurePrimary(true)
];
}
}
foreach ($ob->shedules as $dayNumber => $arTimes){
foreach ($arTimes as $val){
$time = new CustomSchedule(false);
$time->setDayNumber($dayNumber)->setTime(\Helper::getMinutesByHourseString($val));
$time->setUniq(time());
$gameMode->addToSchedules($time);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question