DNADesign\Elemental\Tests\Src\TestElement
Synopsis
class TestElement
extends BaseElement
implements
TestOnly
{
- // members
- private static string $table_name = 'TestElement';
- private static array $db = ;
- private static $controller_class = TestElementController::class;
- // Inherited members from BaseElement
- protected ElementController $controller;
- protected $cacheData;
- protected static array $used_anchors;
- protected $anchor;
- // Inherited methods from BaseElement
- public boolean canView()
- public boolean canEdit()
- public boolean canDelete()
- public boolean canCreate()
- public void onBeforeWrite()
- public void getCMSFields()
- public string getType()
- public bool inlineEditable()
- public $this setController()
- public ElementController getController()
- public $this setAreaRelationNameCache()
- public Controller Top()
- public string|null forTemplate()
- public array getRenderTemplates()
- public void updateFromFormData()
- protected string stripNamespacing()
- public string getSimpleClassName()
- public null|SiteTree getPage()
- public string getAnchor()
- public string|null AbsoluteLink()
- public string Link()
- public string PreviewLink()
- public boolean isCMSPreview()
- public null|string CMSEditLink()
- public int|string getAreaRelationName()
- public string sanitiseClassName()
- public void unsanitiseClassName()
- public null|string getEditLink()
- public DBField|null PageCMSEditLink()
- public string getMimeType()
- public string getSummary()
- public static array getBlockConfig()
- public array getBlockSchema()
- protected array provideBlockSchema()
- public null|DBHTMLText getIcon()
- public string getDescription()
- public DBField getTypeNice()
- public DBHTMLText getEditorPreview()
- public Member getAuthor()
- public string getStyleVariant()
- public mixed|null getPageTitle()
- public boolean First()
- public boolean Last()
- public int TotalItems()
- public int Pos()
- public string EvenOdd()
- public static string getGraphQLTypeName()
Hierarchy
Members
private
- $controller_class
- $db
- $table_name
protected
- $anchor
—
string
For caching 'getAnchor' - $cacheData
—
array
Cache various data to improve CMS load time - $controller — DNADesign\Elemental\Controllers\ElementController
- $used_anchors
—
array
Store used anchor names, this is to avoid title clashes when calling 'getAnchor'
Methods
public
Inherited from DNADesign\Elemental\Models\BaseElement
protected
- provideBlockSchema() — Provide block schema data, which will be serialised and sent via GraphQL to the editor client.
- stripNamespacing() — Strip all namespaces from class namespace.
public
- AbsoluteLink()
- CMSEditLink()
- EvenOdd()
- First()
- Last()
- Link()
- PageCMSEditLink()
- Pos() — Returns the position of the current element.
- PreviewLink()
- Top()
- TotalItems()
- canCreate() — Basic permissions, defaults to page perms where possible.
- canDelete() — Basic permissions, defaults to page perms where possible.
- canEdit() — Basic permissions, defaults to page perms where possible.
- canView() — Basic permissions, defaults to page perms where possible.
- forTemplate() — Default way to render element in templates. Note that all blocks should be rendered through their {@link ElementController} class as this contains the holder styles.
- getAnchor() — Get a unique anchor name
- getAreaRelationName() — Retrieve a elemental area relation for creating cms links
- getAuthor()
- getBlockConfig() — The block config defines a set of data (usually set through config on the element) that will be made available in client side config. Individual element types may choose to add config variable for use in React code
- getBlockSchema() — The block actions is an associative array available for providing data to the client side to be used to describe actions that may be performed. This is available as a plain "ObjectType" in the GraphQL schema.
- getCMSFields()
- getController()
- getDescription() — Get a description for this content element, if available
- getEditLink()
- getEditorPreview()
- getGraphQLTypeName()
- getIcon() — Generate markup for element type icons suitable for use in GridFields.
- getMimeType()
- getPage()
- getPageTitle()
- getRenderTemplates()
- getSimpleClassName()
- getStyleVariant() — Get a user defined style variant for this element, if available
- getSummary() — This can be overridden on child elements to create a summary for display in GridFields.
- getType() — Get the type of the current block, for use in GridField summaries, block type dropdowns etc. Examples are "Content", "File", "Media", etc.
- getTypeNice() — Generate markup for element type, with description suitable for use in GridFields.
- inlineEditable() — Proxy through to configuration setting 'inline_editable'
- isCMSPreview()
- onBeforeWrite() — Increment the sort order if one hasn't been already defined. This ensures that new elements are created at the end of the list by default.
- sanitiseClassName() — Sanitise a model class' name for inclusion in a link.
- setAreaRelationNameCache()
- setController()
- unsanitiseClassName()
- updateFromFormData() — Given form data (wit