public function isValid()
{
$header_valid = false;
if ($this->getHeader()) {
$header_valid = $this->getHeader()->isValid();
}
$items = $this->getChildren();
$one_item_valid = false;
if ($items) {
foreach ($items as $item) {
if ($item->isValid()) {
$one_item_valid = true;
break;
}
}
}
$footer_valid = true;
if ($this->getFooter()) {
$footer_valid = $this->getFooter()->isValid();
}
return $this->canonicalURL && !Type::isTextEmpty($this->canonicalURL) && $header_valid && $footer_valid && $one_item_valid;
}