public function Csl::getParent in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x src/Csl.php \Drupal\bibcite\Csl::getParent()
Get parent style identifier.
Return value
null|string Identifier of the parent style or NULL.
File
- src/
Csl.php, line 63
Class
- Csl
- Simple wrapper for CSL XML.
Namespace
Drupal\bibciteCode
public function getParent() {
/** @var \SimpleXMLElement $link */
foreach ($this->xml->info->link as $link) {
$attributes = $link
->attributes();
if (isset($attributes->rel, $attributes->href) && (string) $attributes->rel === 'independent-parent') {
return (string) $attributes->href;
}
}
return NULL;
}