protected function QuizQuestionEntityTrait::getFormat in Quiz 8.6
Same name and namespace in other branches
- 8.5 src/Entity/QuizQuestionEntityTrait.php \Drupal\quiz\Entity\QuizQuestionEntityTrait::getFormat()
- 6.x src/Entity/QuizQuestionEntityTrait.php \Drupal\quiz\Entity\QuizQuestionEntityTrait::getFormat()
Utility function that returns the format of the node body.
Return value
string|null The format of the node body
File
- src/
Entity/ QuizQuestionEntityTrait.php, line 202
Class
- QuizQuestionEntityTrait
- A trait all Quiz question strongly typed entity bundles must use.
Namespace
Drupal\quiz\EntityCode
protected function getFormat() {
$node = isset($this->node) ? $this->node : $this->question;
$body = field_get_items('node', $node, 'body');
return isset($body[0]['format']) ? $body[0]['format'] : NULL;
}