Test node bundle
This commit is contained in:
parent
e09fdbe5d0
commit
196b1f1517
2 changed files with 21 additions and 0 deletions
16
web/modules/custom/example/src/PostWrapper.php
Normal file
16
web/modules/custom/example/src/PostWrapper.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\example;
|
||||
|
||||
use Drupal\node\NodeInterface;
|
||||
|
||||
final class PostWrapper {
|
||||
|
||||
public function __construct(private NodeInterface $post) {
|
||||
}
|
||||
|
||||
public function getType(): string {
|
||||
return $this->post->bundle();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue