private static function validateIdSegment(&$idSegment)
{
if (empty($idSegment) || is_numeric($idSegment) && $idSegment == 0) {
$idSegment = null;
} elseif (!is_numeric($idSegment)) {
throw new Exception('Invalid segment identifier. Should be an integer.');
} elseif (self::getSegment($idSegment) == null) {
throw new Exception('Segment with id ' . $idSegment . ' does not exist or SegmentEditor is not activated.');
}
}