UncleCheese\Dashboard\DashboardHasManyRelationEditor
A custom FormField object used to manage has_many relations to a DashboardPanel.
Note: All has_many relations must be descendants of
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class DashboardHasManyRelationEditor
extends FormField
{
- // members
- private static array $allowed_actions = ;
- private static array $url_handlers = ;
- protected DashboardPanel $controller;
- protected $relationName;
- protected $relationClass;
- protected DataList $records;
- protected string $template = "UncleCheese\Dashboard\DashboardHasManyRelationEditor";
- // methods
- public void __construct()
- public void setTemplate()
- public ArrayList Items()
- public DBHTMLText FieldHolder()
- public HTTPResponse handleItem()
- public DBHTMLText index()
- public HTTPResponse sort()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Members
private
- $allowed_actions
- $url_handlers
protected
- $controller — UncleCheese\Dashboard\DashboardPanel
- $records — SilverStripe\ORM\DataList
- $relationClass — string
- $relationName — string
- $template — string
Methods
public
- __construct() — The contructor for the editor. Sets member properties and checks for major errors.
- FieldHolder() — Renders the form field
- Items() — Gets all of the items in the relation and provides edit/delete links for the table
- handleItem() — Handles a request for a record in the table
- index() — A default controller action that renders the editor
- setTemplate() — Sets the template of the editor
- sort() — A controller action that handles the reordering of the list