public function checkValidity()
{
$sane = true;
if ($this->id) {
$el = Element\Service::getElementById($this->type, $this->id);
if (!$el instanceof Element\ElementInterface) {
$sane = false;
Logger::notice("Detected insane relation, removing reference to non existent " . $this->type . " with id [" . $this->id . "]");
$this->id = null;
$this->type = null;
$this->subtype = null;
$this->element = null;
}
}
return $sane;
}