code: protected function parentId() {
      switch( $this->position ) {
        case 'root':
          return NULL;
  
        case 'child':
          return $this->target->getKey();
  
        default:
          return $this->target->getParentId();
      }
    }
docs: Computes the new parent id for the node being moved.
  
  @return int