Skip to content

Instantly share code, notes, and snippets.

@crystaldaking
Created November 26, 2019 08:44
Show Gist options
  • Save crystaldaking/d6bb163b1691440df1786cfda7459387 to your computer and use it in GitHub Desktop.
Save crystaldaking/d6bb163b1691440df1786cfda7459387 to your computer and use it in GitHub Desktop.
запись опций
В схеме данных minishop2 ДЛЯ ДОЛБАЕБОВ НАПИСАНО
<object class="msProduct" extends="modResource">
..............................
<composite alias="Options" class="msProductOption" local="id" foreign="product_id" cardinality="many"
owner="local"/>
</object>
Поэтому ваш код должен быть ПРИМЕРНО БЛЯТЬ ТАКИМ
foreach ($resources as $res) {
$data = $res->getMany('Options');
foreach ($data as $opt) {
.............
$opt->save();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment