public function LinkCheckerLink::setParentEntity in Link checker 8
Sets a entity where the link was found.
Parameters
\Drupal\Core\Entity\FieldableEntityInterface $entity: Entity.
Return value
$this
Overrides LinkCheckerLinkInterface::setParentEntity
File
- src/
Entity/ LinkCheckerLink.php, line 186
Class
- LinkCheckerLink
- Defines the linkcheckerlink type entity.
Namespace
Drupal\linkchecker\EntityCode
public function setParentEntity(FieldableEntityInterface $entity) {
$this
->get('entity_id')->target_id = $entity
->id();
$this
->get('entity_id')->target_type = $entity
->getEntityTypeId();
return $this;
}