gorriecoe\Link\Models\Link
Link
Synopsis
class Link
extends DataObject
implements
ScaffoldingProvider
{
- // members
- private static string $table_name = 'Link';
- private static array $db = ;
- private static array $has_one = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static array $styles = ;
- private static array $types = ;
- private static $allowed_types = NULL;
- private static array $casting = ;
- private static string $linking_mode_default = 'link';
- private static string $linking_mode_current = 'current';
- private static string $linking_mode_section = 'section';
- private static boolean $link_to_folders = false;
- private static array $gql_fields = ;
- private static Array $gql_nested_queries = ;
- protected array $classes = ;
- protected $template_style;
- // methods
- public FieldList getCMSFields()
- public Array getCMSMainFields()
- public ValidationResult validate()
- public void onBeforeWrite()
- public void provideGraphQLScaffolding()
- public Array gqlFields()
- public Array gqlNestedQueries()
- public Link addExtraClass()
- public Link setClass()
- public Link setStyle()
- public Link getStyle()
- public Link setAllowedTypes()
- public array getTypes()
- public array geti18nTypes()
- public array getStyles()
- public array geti18nStyles()
- public string getLinkURL()
- public string getClass()
- public HTMLFragment getClassAttr()
- public string getTarget()
- public HTMLFragment getTargetAttr()
- public string getIDValue()
- public HTMLFragment getIDAttr()
- public Controller getCurrentPage()
- public bool isCurrent()
- public bool isSection()
- public bool isOrphaned()
- public string LinkOrCurrent()
- public string LinkOrSection()
- public string LinkingMode()
- public string getTypeLabel()
- public string baseClassName()
- public DBHTMLText forTemplate()
- public string getLayout()
- public array getRenderTemplates()
- public bool canView()
- public bool canEdit()
- public bool canDelete()
- public bool canCreate()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Implements
- SilverStripe\GraphQL\Scaffolding\Interfaces\ScaffoldingProvider
Members
private
- $allowed_types
—
array
List the allowed included link types. If null all are allowed. - $casting
—
array
Ensures that the methods are wrapped in the correct type and values are safely escaped while rendering in the template. - $db
—
array
Database fields -
$gql_fields
Provides a quick way to define additional methods for provideGraphQLScaffolding as Fields - $gql_nested_queries
—
gorriecoe\Link\Models\Array
Provides a quick way to define additional methods for provideGraphQLScaffolding as Nested Queries - $has_one
—
array
Has_one relationship - $link_to_folders
—
boolean
If false, when Type is "File", folders in the TreeDropdownField will not be selectable. - $linking_mode_current — string
- $linking_mode_default — string
- $linking_mode_section — string
- $searchable_fields
—
array
Defines a default list of filters for the search context - $styles
—
array
A map of styles that are available in the cms for users to select from. - $summary_fields
—
array
Defines summary fields commonly used in table columns as a quick overview of the data for this dataobject - $table_name
—
string
Defines the database table name - $types
—
array
A map of object types that can be linked to Custom dataobjects can be added to this
protected
- $classes — string
- $template_style — string
Methods
public
- LinkOrCurrent() — Return "link" or "current" depending on if this is the {@link Link::isCurrent()} current page.
- LinkOrSection() — Return "link" or "section" depending on if this is the {@link Link::isSection()} current section.
- LinkingMode() — Return "link", "current" or "section" depending on if this page is the current page, or not on the current page but in the current section.
- addExtraClass() — Set CSS classes for templates
- baseClassName() — Returns the base class without namespacing
- canCreate()
- canDelete()
- canEdit()
- canView()
- forTemplate() — Renders an HTML anchor attribute for this link
- getCMSFields() — CMS Fields
- getCMSMainFields() — CMS Main fields This is so other modules can access these fields without other tabs etc.
- getClass() — Returns the css classes
- getClassAttr() — Returns the html class attribute
- getCurrentPage() — Returns the current page scope
- getIDAttr() — Renders an HTML ID attribute
- getIDValue() — Returns the html id attribute
- getLayout() — Renders an HTML anchor tag for this link This is an alias to {@link forTemplate()}
- getLinkURL() — Works out what the URL for this link should be based on it's Type
- getRenderTemplates() — Returns a list of rendering templates
- getStyle() — Get style defined by the template or admin
- getStyles() — Returns available styles
- getTarget() — Returns the html target attribute
- getTargetAttr() — Returns the html target attribute
- getTypeLabel() — Returns the description label of this links type
- getTypes() — Returns allowed link types
- geti18nStyles() — Returns available styles with translations
- geti18nTypes() — Returns allowed link types with translations
- gqlFields() — Provides a quick way to define additional methods to provideGraphQLScaffolding as Fields
- gqlNestedQueries() — Provides a quick way to define additional methods to provideGraphQLScaffolding as Nested Queries
- isCurrent() — Returns true if this is the currently active page being used to handle this request.
- isOrphaned() — Check if the parent of this page has been removed (or made otherwise unavailable), and is still referenced by this child. Any such orphaned page may still require access via the CMS, but should not be shown as accessible to external users.
- isSection() — Check if this page is in the currently active section (e.g. it is either current or one of its children is currently being viewed).
- onBeforeWrite() — Event handler called before writing to the database.
- provideGraphQLScaffolding()
- setAllowedTypes() — Sets allowed link types
- setClass() — This is an alias to {@link addExtraClass()}
- setStyle() — Set style used for
- validate() — Validate