mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-06-28 23:49:32 +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);
|
$tags = $this->getTagsObjects($category, $value);
|
||||||
|
|
||||||
if ($tags->Count() > 0) {
|
if ($tags->Count() > 0) {
|
||||||
$tagsToDelete = array();
|
|
||||||
|
|
||||||
foreach($tags as $t) {
|
foreach($tags as $t) {
|
||||||
$documentList = $t->Documents();
|
$documentList = $t->Documents();
|
||||||
|
|
||||||
|
@ -172,13 +170,6 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||||
//delete the entire tag if it has no relations left
|
//delete the entire tag if it has no relations left
|
||||||
if ($documentList->Count() == 0) $t->delete();
|
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
|
* @return null
|
||||||
*/
|
*/
|
||||||
function removeAllTags() {
|
function removeAllTags() {
|
||||||
$tagsToDelete = array();
|
|
||||||
$allTags = $this->Tags();
|
$allTags = $this->Tags();
|
||||||
foreach($allTags as $tag) {
|
foreach($allTags as $tag) {
|
||||||
$documentlist = $tag->Documents();
|
$documentlist = $tag->Documents();
|
||||||
$documentlist->remove($this);
|
$documentlist->remove($this);
|
||||||
if ($tag->Documents()->Count() == 0) $tag->delete();
|
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