Undefined offset: 0-wp-includes/meta.php:488 -Melding

You should change $parents[] to $parents in get_parents() function:

$parents = get_metadata('post', $post_id, WPKWP::$META_CHILD, false);
if ($parents !== FALSE && count($parents) > 0)
    return $parents;
return false;

because get_metadata return array in this case. If the $post_id parameter is invalid, false is returned. If the meta value isn’t set, function return an empty array.
Therefore, $parents array always will contain one element – false, empty array or array with values. The condition count($parents) > 0 is always true.

Define variable $meta = null; before if (WPKWP::get_parent()). If condition is true then only local $meta variable (invisible in return line) is created.

You define function get_parents but in get_post_metadata() you have WPKWP::get_parent().