function CourseObjectNode::postSave in Course 8.2
Same name and namespace in other branches
- 8.3 modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::postSave()
- 3.x modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::postSave()
On object write, set privacy on this node.
Overrides CourseObject::postSave
File
- modules/
course_content/ src/ Course/ Object/ CourseObjectNode.php, line 321
Class
- CourseObjectNode
- A course object that uses a node as a base.
Namespace
Drupal\course_content\Course\ObjectCode
function postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = TRUE) {
$privacy_enabled = $this
->hasNodePrivacySupport() && $this
->getOption('private');
$external_node = $this
->getInstanceId() > 0;
if ($privacy_enabled && $external_node) {
\Drupal::entityTypeManager()
->getAccessControlHandler('node')
->resetCache();
}
parent::postSave($storage, $update);
}