Answer the question
In order to leave comments, you need to log in
What am I doing wrong with the collection?
Greetings colleagues, a question arose about collections - in the documentation about this in pieces, I collected examples, but when they are executed, the data in the table does not change. Please advise what I am doing wrong.
Row deletion example
$query = MyTable::getList(['filter' => ['ID' => [1, 2]]]);
$data = $query->fetchCollection();
foreach ($data as $item){
$data->remove($item);
}
$data->save();
$collectionClass = MyTable::getCollectionClass();
$books = $collectionClass::wakeUp([
['ID' => 1, 'PROP' => 'a'],
['ID' => 2, 'PROP' => 'b']
]);
$books->save(true);
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