5c: Add the node as a constructor argument
> Undefined variable: node
This commit is contained in:
parent
1fe7119b5d
commit
61664cb263
2 changed files with 9 additions and 1 deletions
|
|
@ -2,8 +2,16 @@
|
|||
|
||||
namespace Drupal\my_module\Entity;
|
||||
|
||||
use Drupal\node\NodeInterface;
|
||||
|
||||
class Post {
|
||||
|
||||
private $node;
|
||||
|
||||
public function __construct(NodeInterface $node) {
|
||||
$this->node = $node;
|
||||
}
|
||||
|
||||
public function getTitle(): string {
|
||||
return '';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue