Last active
January 25, 2023 20:36
-
-
Save dima731515/e68a15e63bfb199b02acba7ebe095dbb to your computer and use it in GitHub Desktop.
Битрикс, D7, ORM "Множественное поле"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
/** | |
* Определение поля в методе getMap ORM класса (ClinicTable) | |
* опция serialize | |
*/ | |
class ClinicTable extends \Bitrix\Main\ORM\Data\DataManager | |
{ | |
public static function getMap() | |
{ | |
return [ | |
(new \Bitrix\Main\ORM\Fields\ArrayField('UF_PHONE')) | |
->configureSerializationPhp()) | |
->configureTitle(Loc::getMessage('CLINICS_ENTITY_UF_PHONE_FIELD')), | |
]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
$newClinic = ClinicTable::createObject(); | |
$newClinic->set('UF_PHONE', ['790333322222', '790333322222']); | |
$newClinic->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment