Sheadawson\Linkable\Models\Link
Class Link
- Author: <shea@silverstripe.com.au>
- License: BSD License http://www.silverstripe.org/bsd-license
Synopsis
class Link
extends DataObject
{
- // members
- protected $cssClass;
- private static array $db = ;
- private static array $has_one = ;
- private static string $table_name = 'LinkableLink';
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static array $templates = ;
- private static array $types = ;
- private static $allowed_types = NULL;
- private static array $casting = ;
- protected $allowed_types_override = NULL;
- // methods
- public FieldList getCMSFields()
- public void onAfterWrite()
- public $this setCSSClass()
- public $this setAllowedTypes()
- public array getTypes()
- public DBHTMLText|string forTemplate()
- public bool|mixed|null|string getLinkURL()
- public array|string getClasses()
- public string getClassAttr()
- public string getTargetAttr()
- public null|string getLinkType()
- public bool getTypeHasDbField()
- public ValidationResult validate()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
- $allowed_types
—
array
List the allowed included link types. If null all are allowed. - $casting
- $db — array
- $has_one — array
- $searchable_fields — array
- $summary_fields — array
- $table_name — string
- $templates
—
array
A map of templates that are available for rendering Link objects with - $types
—
array
A map of object types that can be linked to Custom dataobjects can be added to this
protected
- $allowed_types_override
—
array
List the allowed included link types. If null all are allowed. - $cssClass — string
Methods
public
- forTemplate() — Renders an HTML anchor tag for this link
- getCMSFields()
- getClassAttr() — Gets the html class attribute for this link.
- getClasses() — Gets the classes for this link.
- getLinkType() — Gets the description label of this links type
- getLinkURL() — Works out what the URL for this link should be based on it's Type
- getTargetAttr() — Gets the html target attribute for the anchor tag
- getTypeHasDbField() — Check if the selected type has a db field otherwise assume its a related object.
- getTypes() — Returns allowed link types
- onAfterWrite() — If the title is empty, set it to getLinkURL()
- setAllowedTypes() — Sets allowed link types
- setCSSClass()
- validate() — Validate