public function ParagraphBlocksEntityManager::getRefererEntity in Paragraph blocks 8
Same name and namespace in other branches
- 8.2 src/ParagraphBlocksEntityManager.php \Drupal\paragraph_blocks\ParagraphBlocksEntityManager::getRefererEntity()
- 3.x src/ParagraphBlocksEntityManager.php \Drupal\paragraph_blocks\ParagraphBlocksEntityManager::getRefererEntity()
Return the entity of the referer, useful when called via AJAX.
Return value
\Drupal\Core\Entity\EntityInterface|null The entity of the referer, or null if none.
File
- src/
ParagraphBlocksEntityManager.php, line 125
Class
- ParagraphBlocksEntityManager
- Class HcpCoreManager.
Namespace
Drupal\paragraph_blocksCode
public function getRefererEntity() {
$referer = $this->requestStack
->getCurrentRequest()->server
->get('HTTP_REFERER');
if ($referer) {
$path = parse_url($referer, PHP_URL_PATH);
if ($path) {
return $this
->getEntity($path);
}
}
return NULL;
}