original_string: protected function _calculateItemId(EntityInterface $item)
      {
          if ($item->has('id')) {
              return $item->id;
          }
  
          if (is_array($item->url)) {
              return Inflector::slug(strtolower(implode(' ', array_values($item->url))));
          }
  
          return Inflector::slug(strtolower($item->url));
      }
code: protected function _calculateItemId(EntityInterface $item)
      {
          if ($item->has('id')) {
              return $item->id;
          }
  
          if (is_array($item->url)) {
              return Inflector::slug(strtolower(implode(' ', array_values($item->url))));
          }
  
          return Inflector::slug(strtolower($item->url));
      }
code_tokens: protected function _calculateItemId ( EntityInterface $ item ) { if ( $ item -> has ( 'id' ) ) { return $ item -> id ; } if ( is_array ( $ item -> url ) ) { return Inflector :: slug ( strtolower ( implode ( ' ' , array_values ( $ item -> url ) ) ) ) ; } return Inflector :: slug ( strtolower ( $ item -> url ) ) ; }
docstring: Calculates an item's ID
  
  @param \Cake\Datasource\EntityInterface $item The item
  @return string The ID, it may be an empty
docstring_tokens: Calculates an item s ID