mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
MINOR: removing comments
This commit is contained in:
parent
7b18e3ba7e
commit
de09822ce0
@ -161,8 +161,6 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
$tags = $this->getTagsObjects($category, $value);
|
||||
|
||||
if ($tags->Count() > 0) {
|
||||
$tagsToDelete = array();
|
||||
|
||||
foreach($tags as $t) {
|
||||
$documentList = $t->Documents();
|
||||
|
||||
@ -172,13 +170,6 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
//delete the entire tag if it has no relations left
|
||||
if ($documentList->Count() == 0) $t->delete();
|
||||
}
|
||||
|
||||
//TODO: remove this comment if unit tests work fine
|
||||
//delete after the loop, so it doesn't conflict with the loop of the $tags list
|
||||
// foreach($tagsToDelete as $tID) {
|
||||
// $tag = DataObject::get_by_id("DMSTag",$tID);
|
||||
// $tag->delete();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,20 +178,12 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
* @return null
|
||||
*/
|
||||
function removeAllTags() {
|
||||
$tagsToDelete = array();
|
||||
$allTags = $this->Tags();
|
||||
foreach($allTags as $tag) {
|
||||
$documentlist = $tag->Documents();
|
||||
$documentlist->remove($this);
|
||||
if ($tag->Documents()->Count() == 0) $tag->delete();
|
||||
}
|
||||
|
||||
//TODO: remove this comment if unit tests work fine
|
||||
//delete after the loop, so it doesn't conflict with the loop of the $tags list
|
||||
// foreach($tagsToDelete as $tID) {
|
||||
// $tag = DataObject::get_by_id("DMSTag",$tID);
|
||||
// $tag->delete();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user