This is how i create my node :
$value= array(
'type' => 'page',
'title'=>"First node",
'body' => array(
'value' => "test",
'format' => 'full_html',
),
);
$nodeEntity=\Drupal::entityTypeManager()
->getStorage('node')
->create($value);
$nodeEntity->save();
This work fine.
But i try to give a menu parent to this node.
i try that :
$value= array(
'type' => 'page',
'title'=>"First node",
'body' => array(
'value' => "test",
'format' => 'full_html',
),
'menu'=>array(
'title'=>"First node",
'menu_parent'=>6,
'description' => '',
'enabled'=>1
),
);
i set the field menu because it's the name of the field in the node edit form. But for the nodeEntity, this field doesn't exist.
How can i give a parent menu id to my node ?
UPDATE
if i set menu_link instead of menu, i got no error i still can't see the menu on the node.