{"action":"created","issue":{"url":"https://api.github.com/repos/PHPOffice/PHPWord/issues/1303","repository_url":"https://api.github.com/repos/PHPOffice/PHPWord","labels_url":"https://api.github.com/repos/PHPOffice/PHPWord/issues/1303/labels{/name}","comments_url":"https://api.github.com/repos/PHPOffice/PHPWord/issues/1303/comments","events_url":"https://api.github.com/repos/PHPOffice/PHPWord/issues/1303/events","html_url":"https://github.com/PHPOffice/PHPWord/issues/1303","id":302232193,"number":1303,"title":"Delete text from section","user":{"login":"maba4891","id":15227261,"avatar_url":"https://avatars3.githubusercontent.com/u/15227261?v=4","gravatar_id":"","url":"https://api.github.com/users/maba4891","html_url":"https://github.com/maba4891","followers_url":"https://api.github.com/users/maba4891/followers","following_url":"https://api.github.com/users/maba4891/following{/other_user}","gists_url":"https://api.github.com/users/maba4891/gists{/gist_id}","starred_url":"https://api.github.com/users/maba4891/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maba4891/subscriptions","organizations_url":"https://api.github.com/users/maba4891/orgs","repos_url":"https://api.github.com/users/maba4891/repos","events_url":"https://api.github.com/users/maba4891/events{/privacy}","received_events_url":"https://api.github.com/users/maba4891/received_events","type":"User","site_admin":false},"labels":[{"id":87735045,"url":"https://api.github.com/repos/PHPOffice/PHPWord/labels/Responded","name":"Responded","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-05T09:48:34Z","updated_at":"2018-03-08T15:56:31Z","closed_at":null,"author_association":"NONE","body":"Here's the thing: I create a phpword object and add sections and text. But before I write the object to the final docx document I need to look at the whole thing again and might have to make some changes (especially deleting text again). It would be nice to do this at the end because I have a lot of complex conditions on how to fill the object. \r\n\r\nHere is where I am so far:\r\n```\r\n// creating new object, adding section and texts\r\n$phpWord = new \\PhpOffice\\PhpWord\\PhpWord();\r\n$section = $phpWord->createSection();\r\n$section->addText(\"Text1\");\r\n$section->addText(\"Text2\");\r\n\r\n// .. continue filling the document based on complex conditions\r\n```\r\nThe question now is: How can I delete elements???\r\n\r\nOf course I can get the elements from $section via getElements():\r\n```\r\n// get all elements of the section\r\n$section_elements = $section->getElements();\r\n// delete one element from this array\r\nunset($section_elements[1]);\r\n```\r\nBut that only deletes the text from the $section_elements array and leaves the phpword object untouched. **So how can I delete elements from the phpword object itself before writing it to a docx file?**\r\n\r\nThanks!\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/PHPOffice/PHPWord/issues/comments/371530586","html_url":"https://github.com/PHPOffice/PHPWord/issues/1303#issuecomment-371530586","issue_url":"https://api.github.com/repos/PHPOffice/PHPWord/issues/1303","id":371530586,"user":{"login":"maba4891","id":15227261,"avatar_url":"https://avatars3.githubusercontent.com/u/15227261?v=4","gravatar_id":"","url":"https://api.github.com/users/maba4891","html_url":"https://github.com/maba4891","followers_url":"https://api.github.com/users/maba4891/followers","following_url":"https://api.github.com/users/maba4891/following{/other_user}","gists_url":"https://api.github.com/users/maba4891/gists{/gist_id}","starred_url":"https://api.github.com/users/maba4891/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maba4891/subscriptions","organizations_url":"https://api.github.com/users/maba4891/orgs","repos_url":"https://api.github.com/users/maba4891/repos","events_url":"https://api.github.com/users/maba4891/events{/privacy}","received_events_url":"https://api.github.com/users/maba4891/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T15:56:31Z","updated_at":"2018-03-08T15:56:31Z","author_association":"NONE","body":"Thanks for the quick reaction! :+1:  I am busy with another urgent project right now but will have a look at it asap and will report back here :)"}}
{"actor":{"display_login":"maba4891"}}