/** * Find menu item identifier * * @param NodeInterface $node * @param Context $context * * @return int */ protected function findMenuItemId(NodeInterface $node, Context $context) { /* @var $node \USync\AST\Drupal\MenuItemNode */ // SERIOUS FIXME // Sorry, from this point I am making the same error as features... // ... meaning using the path as identifier, but except by doing a // mapping table, I'm not sure I can do this another way; I should // at least use the complete path return db_query("SELECT mlid FROM {menu_links} WHERE link_title = :title AND menu_name = :menu", [':title' => $node->getLinkTitle(), ':menu' => $node->getMenuName()])->fetchField(); }