code: public function getDefinitionIndex($id) {
          $definition = $this->getDefinition($id);
  
          foreach ($this->definitions as $index => $item) {
              if ($item === $definition) {
                  return $index;
              }
          }
      }
docs: @param $id
  
  @return int|null|string