code: public function updateValues()
      {
          $values = [];
          /* @var NodeInterface $item */
          foreach ($this->getItems() as $item) {
              if (!is_null($item)) {
                  $values[] = $item->getValueWithParents();
              }
          }
  
          $this->values = $values;
      }
docs: Updates the item values.
  
  @ODM\PrePersist
  @ODM\PreUpdate