-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
Lets say we have the following record relation: a book (parent) has multiple chapters (children), defined like this:
TCA configuration:
//book.php
'ctrl' => [
'delete' => 'deleted',
],
'columns' => [
'chapters' => [
'config' => [
'type' => 'inline',
'foreign_table' => 'chapter',
'foreign_field' => 'book_uid',
'maxitems' => 9999,
'behaviour' => [
'enableCascadingDelete' => TRUE,
],
],
],
],
//chapter.php
'ctrl' => [
'delete' => 'deleted',
],
Model: Book.php
/**
* @T3api\ApiResource(
* itemOperations={
* "delete"={
* "method"="DELETE",
* "path"="/book/{id}",
* },
* },
* )
*/
class Book extends AbstractEntity {
/**
* @var ObjectStorage<Chapter>
* @T3api\Serializer\Groups({
* "api_book_post_collection",
* })
* @T3api\ORM\Cascade("persist")
*/
protected $chapters;
}
The request DELETE /api/book/123 will set deleted=1 for parent record 123, but not for the child-records.
Instead, if the record 123 is deleted in the TYPO3 backend list view, also the child-records are marked as deleted.
I tried it also with the replaced annotation @T3api\ORM\Cascade("delete") but with the same result.
Metadata
Metadata
Assignees
Labels
No labels