Skip to content

Commit

Permalink
TASK: Introduce b/c layer for Node::getLabel()
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed May 13, 2024
1 parent 30b861f commit b687896
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,28 @@ public function hasProperty(string $propertyName): bool
return $this->properties->offsetExists($propertyName);
}

/**
* Returned the node label as generated by the configured node label generator.
*
* In PHP please use Neos' {@see NodeLabelRendererInterface} instead.
*
* For Fusion please use the FlowQuery operation:
* ```
* ${q(node).label()}
* ```
*
* @deprecated will be removed before the final 9.0 release
*/
public function getLabel(): string
{
if (!class_exists(\Neos\Neos\Domain\NodeLabel\NodeLabelRenderer::class)) {
throw new \BadMethodCallException('node labels are removed from standalone cr.');
}
// highly illegal
/** @phpstan-ignore-next-line */
return (new \Neos\Neos\Domain\NodeLabel\NodeLabelRenderer())->renderNodeLabel($this)->value;
}

public function equals(Node $other): bool
{
return $this->subgraphIdentity->equals($other->subgraphIdentity)
Expand Down

0 comments on commit b687896

Please sign in to comment.