public function FlagViewsLinkField::getFlag in Flag 8.4
A helper method to retrieve the flag entity from the views relationship.
Return value
\Drupal\flag\FlagInterface|null The flag selected by the views relationship.
File
- src/
Plugin/ views/ field/ FlagViewsLinkField.php, line 71
Class
- FlagViewsLinkField
- Provides a views field to flag or unflag the selected content.
Namespace
Drupal\flag\Plugin\views\fieldCode
public function getFlag() {
if ($this->flag) {
return $this->flag;
}
elseif (isset($this->view->relationship[$this->options['relationship']])) {
return $this->view->relationship[$this->options['relationship']]
->getFlag();
}
return NULL;
}