NodeLabelToken
class NodeLabelToken implements ProtectedContextAwareInterface (View source)
Provides a chainable interface to build a label for a nodetype with a fallback mechanism.
Properties
protected TranslationHelper | $translationHelper | ||
protected StringHelper | $stringHelper | ||
protected string | $label | ||
protected int | $length | ||
protected string | $suffix | ||
protected string | $prefix | ||
protected string | $postfix | ||
protected NodeInterface | $node |
Methods
No description
No description
Add a text before the main label
Add a text after the main label (can will be cropped)
No description
Runs evaluate to avoid the need of calling evaluate as a finishing method
Crops, removes special chars & tags and trim the label.
Sets the label and postfix based on the nodetype
No description
All methods are considered safe
Details
__construct(NodeInterface $node)
No description
NodeLabelToken
override(string $override = null)
No description
NodeLabelToken
crop(int $length, string $suffix = '...')
No description
NodeLabelToken
prefix(string $prefix)
Add a text before the main label
NodeLabelToken
postfix(string $postfix)
Add a text after the main label (can will be cropped)
NodeLabelToken
properties(string ...$propertyNames)
No description
string
__toString()
Runs evaluate to avoid the need of calling evaluate as a finishing method
string
evaluate()
Crops, removes special chars & tags and trim the label.
If the label is empty a fallback based on the nodetype is provided.
protected void
resolveLabelFromNodeType()
Sets the label and postfix based on the nodetype
protected string
sanitiseLabel(string $label)
No description
bool
allowsCallOfMethod(string $methodName)
All methods are considered safe