diff --git a/forms/gridfield/GridFieldDeleteAction.php b/forms/gridfield/GridFieldDeleteAction.php index a84b21a66..dbee43372 100644 --- a/forms/gridfield/GridFieldDeleteAction.php +++ b/forms/gridfield/GridFieldDeleteAction.php @@ -1,11 +1,20 @@ + * $action = new GridFieldDeleteAction(); // delete objects permanently + * $action = new GridFieldDeleteAction(true); // removes the relation to object, instead of deleting + * + * + * @package sapphire + * @subpackage gridfield */ class GridFieldDeleteAction implements GridField_ColumnProvider, GridField_ActionProvider { - /** * If this is set to true, this actionprovider will remove the object from the list, instead of * deleting. In the case of a has one, has many or many many list it will uncouple the item from @@ -17,10 +26,10 @@ class GridFieldDeleteAction implements GridField_ColumnProvider, GridField_Actio /** * - * @param boolean $unlinkRelation - true if removing the item from the list, but not deleting it + * @param boolean $removeRelation - true if removing the item from the list, but not deleting it */ - public function __construct($unlinkRelation = false) { - $this->removeRelation = $unlinkRelation; + public function __construct($removeRelation = false) { + $this->removeRelation = $removeRelation; } /** @@ -30,8 +39,9 @@ class GridFieldDeleteAction implements GridField_ColumnProvider, GridField_Actio * @param array $columns */ public function augmentColumns($gridField, &$columns) { - if(!in_array('Actions', $columns)) + if(!in_array('Actions', $columns)) { $columns[] = 'Actions'; + } } /** @@ -125,4 +135,4 @@ class GridFieldDeleteAction implements GridField_ColumnProvider, GridField_Actio $gridField->getList()->remove($item); } } -} \ No newline at end of file +}