From ff4c82039d2359f09361cd08d0f6efe70dc9103f Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 23 Mar 2012 10:50:17 +1300 Subject: [PATCH 1/4] MINOR Class documentation for GridFieldDeleteAction --- forms/gridfield/GridFieldDeleteAction.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/forms/gridfield/GridFieldDeleteAction.php b/forms/gridfield/GridFieldDeleteAction.php index a84b21a66..87f0d8c82 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 @@ -125,4 +134,4 @@ class GridFieldDeleteAction implements GridField_ColumnProvider, GridField_Actio $gridField->getList()->remove($item); } } -} \ No newline at end of file +} From 239b4a01f73dd64b7ff85655fd440f557f4476b6 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 23 Mar 2012 10:51:23 +1300 Subject: [PATCH 2/4] MINOR Rename argument to GridFieldDeleteAction to match the property name $removeRelation MINOR Tidy up coding standards in GridFieldDeleteAction --- forms/gridfield/GridFieldDeleteAction.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/forms/gridfield/GridFieldDeleteAction.php b/forms/gridfield/GridFieldDeleteAction.php index 87f0d8c82..1325df92f 100644 --- a/forms/gridfield/GridFieldDeleteAction.php +++ b/forms/gridfield/GridFieldDeleteAction.php @@ -26,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; } /** @@ -39,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'; + } } /** From 98cc25a5fe147303f5544f6e709fb7ce9c9c5c71 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 23 Mar 2012 10:53:32 +1300 Subject: [PATCH 3/4] MINOR Tidy up of class documentation for GridFieldDeleteAction --- forms/gridfield/GridFieldDeleteAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms/gridfield/GridFieldDeleteAction.php b/forms/gridfield/GridFieldDeleteAction.php index 1325df92f..a1bb28573 100644 --- a/forms/gridfield/GridFieldDeleteAction.php +++ b/forms/gridfield/GridFieldDeleteAction.php @@ -1,6 +1,6 @@ Date: Fri, 23 Mar 2012 10:59:17 +1300 Subject: [PATCH 4/4] MINOR Fixed grammatical error in GridFieldDeleteAction class documentation --- forms/gridfield/GridFieldDeleteAction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/gridfield/GridFieldDeleteAction.php b/forms/gridfield/GridFieldDeleteAction.php index a1bb28573..dbee43372 100644 --- a/forms/gridfield/GridFieldDeleteAction.php +++ b/forms/gridfield/GridFieldDeleteAction.php @@ -2,8 +2,8 @@ /** * This class is a {@link GridField} component that adds a delete action for objects. * - * This will also supports unlinking a relation instead of deleting the object. Use the {@link $removeRelation} - * property set in the constructor. + * This component also supports unlinking a relation instead of deleting the object. + * Use the {@link $removeRelation} property set in the constructor. * * * $action = new GridFieldDeleteAction(); // delete objects permanently