protected function Unpublish404::getItems in Link checker 8
Gets list of items to queue.
List should be like: [ [ 'entity_type' => 'node', 'entity_id' => 123, 'link_id' => 12 ], ... [ 'entity_type' => 'paragraph', 'entity_id' => 1234, 'link_id' => 123 ], ]
Parameters
\Drupal\linkchecker\LinkCheckerLinkInterface $link: The link.
\Psr\Http\Message\ResponseInterface $response: The response of link checking.
Return value
array Array of items.
Overrides LinkStatusHandlerBase::getItems
File
- src/
Plugin/ LinkStatusHandler/ Unpublish404.php, line 27
Class
- Unpublish404
- Unpublish entities on 404 link response.
Namespace
Drupal\linkchecker\Plugin\LinkStatusHandlerCode
protected function getItems(LinkCheckerLinkInterface $link, ResponseInterface $response) {
// If unpublishing limit is reached,
// unpublish all entities having this link.
$actionStatusCode404 = $this->linkcheckerSetting
->get('error.action_status_code_404');
if ($actionStatusCode404 && $actionStatusCode404 <= $link
->getFailCount()) {
return parent::getItems($link, $response);
}
else {
return [];
}
}