silverstripe-framework/src/Forms/GridField/GridField_ActionMenuItem.php
Aaron Carlino 31ad3cdaab
BUGFIX: Allow buttons to opt out of display (#8113)
* Allow buttons to opt out of display

* Linting

* Remove redundant function call

* Add test for group delete action

* Add menu group check and test for delete action

* Fix linting
2018-06-06 21:14:29 +12:00

55 lines
1.4 KiB
PHP

<?php
namespace SilverStripe\Forms\GridField;
use SilverStripe\ORM\DataObject;
/**
* GridField action menu item interface, this provides data so the action
* will be included if there is a {@see GridField_ActionMenu}
*/
interface GridField_ActionMenuItem extends GridFieldComponent
{
/**
* Default group name
*/
const DEFAULT_GROUP = 'Default';
/**
* Gets the title for this menu item
*
* @see {@link GridField_ActionMenu->getColumnContent()}
*
* @param GridField $gridField
* @param DataObject $record
*
* @return string $title
*/
public function getTitle($gridField, $record, $columnName);
/**
* Gets any extra data that could go in to the schema that the menu generates
*
* @see {@link GridField_ActionMenu->getColumnContent()}
*
* @param GridField $gridField
* @param DataObject $record
*
* @return array $data
*/
public function getExtraData($gridField, $record, $columnName);
/**
* Gets the group this menu item will belong to. A null value should indicate
* the button should not display.
*
* @see {@link GridField_ActionMenu->getColumnContent()}
*
* @param GridField $gridField
* @param DataObject $record
*
* @return string|null $group
*/
public function getGroup($gridField, $record, $columnName);
}