ilateral\SilverStripe\CustomMenus\Model\CustomMenuLink
Single link that will appear in this menu. This link can be associated with any generic data object, as long as the object has the following methods/Properties
Methods:
- Link
- AbsoluteLink
- RelativeLink
Properties:
- Title
- MenuTitle
- Author: Mo <morven@ilateral.co.uk>
Synopsis
class CustomMenuLink
extends DataObject
{
- // constants
- const TITLE_FIELD = 'Title';
- const LABEL_FIELD = 'Label';
- const SEARCH_FIELD = 'SearchFields';
- // members
- private static string $table_name = 'CustomMenuLink';
- private static array $base_classes = ;
- private static string $default_label_field = "Title";
- private static array $db = ;
- private static array $has_one = ;
- private static array $default_sort = ;
- private static array $casting = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- // methods
- protected array getAssociativeClasses()
- protected array getNonAssociativeClasses()
- public array getClassesForDropdown()
- public string getLabelField()
- public array getSearchFields()
- public void getCMSFields()
- public DataObject Object()
- public string getTitle()
- public string getType()
- public void canView()
- public void canCreate()
- public void canEdit()
- public void canDelete()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Constants
Name | Value |
---|---|
TITLE_FIELD | 'Title' |
LABEL_FIELD | 'Label' |
SEARCH_FIELD | 'SearchFields' |
Members
private
- $base_classes
—
array
Possible object classes that can be related to this object - $casting
- $db
- $default_label_field
—
string
The field used by the HasOneField to display the linked objects name. - $default_sort
- $has_one
- $searchable_fields
- $summary_fields
- $table_name
Methods
protected
- getAssociativeClasses() — Get a list of all base classes that are multi dimensional in nature
- getNonAssociativeClasses() — Get a list of all base classes that are in a list of simple array values
public
- Object() — Get the associated object by it's ID
- canCreate()
- canDelete()
- canEdit()
- canView()
- getCMSFields()
- getClassesForDropdown() — Get a list of classes suitable for loading into a dropdown
- getLabelField() — See if the configured classes have a custom label
- getSearchFields() — Get a list of search fields for the current class (if defined)
- getTitle() — Get the configured title for the linked object
- getType() — Get the type of object linked to this menu item