Doctrine 1
  1. Doctrine 1
  2. DC-378

Typo in documentation for Taggable Extension

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.2.2
    • Component/s: Extensions
    • Labels:
      None

      Description

      There are some typos in your documentation for Taggable extension.

      In section related to getPopularTags method, if I use your code, like Doctrine::getTable('BlogPost')->getPopularTags(); I get an exception "Unknown method Doctrine_Table::getPopularTags" (with replacing BlogPost by my model name). In effect, it's not the table for my model that I must use but the table for TaggeableTag.
      Besides, in your tests, you use Doctrine::getTable('TaggableTag')

      I have write a patch to fix these typos. It's attached to this ticket.

        Activity

        Hide
        Benjamin Arthur Lupton added a comment -

        I believe the TaggableTag table is used to hold all tags, so if you have multiple tables that use tags, TaggableTag will contain the tags for all the tables using the Taggable extension. By doing: Doctrine::getTable('BlogPost')->getPopularTags(); we only want to get the popular tags for that table alone.

        However, I could be totally wrong???

        Show
        Benjamin Arthur Lupton added a comment - I believe the TaggableTag table is used to hold all tags, so if you have multiple tables that use tags, TaggableTag will contain the tags for all the tables using the Taggable extension. By doing: Doctrine::getTable('BlogPost')->getPopularTags(); we only want to get the popular tags for that table alone. However, I could be totally wrong???
        Hide
        Ivar Nesje added a comment -

        Only problem is that I can not Doctrine::getTable('BogPost')->getPopularTags() throws an exeption.
        You wil have to do as in the test case and make sure that the table clases is loaded.

        // Load the models you want tags form
        Doctrine::getTable('BlogPost');
        Doctrine::getTable('Article');
        // Then the automaticaly generated TaggableTag model can be loaded
        $tags = Doctrine::getTable('TaggableTag')->getPopularTags();
        // or you can spesify spesific models you want tags from
        $tags = Doctrine::getTable('TaggableTag')->getPopularTags(array('BlogPost','Article'));
        

        This is how it works for me, at least. Benjamin, have you tested and got a resonable result from Doctrine::getTable('BlogPost')->getPopularTags()?

        Show
        Ivar Nesje added a comment - Only problem is that I can not Doctrine::getTable('BogPost')->getPopularTags() throws an exeption. You wil have to do as in the test case and make sure that the table clases is loaded. // Load the models you want tags form Doctrine::getTable('BlogPost'); Doctrine::getTable('Article'); // Then the automaticaly generated TaggableTag model can be loaded $tags = Doctrine::getTable('TaggableTag')->getPopularTags(); // or you can spesify spesific models you want tags from $tags = Doctrine::getTable('TaggableTag')->getPopularTags(array('BlogPost','Article')); This is how it works for me, at least. Benjamin, have you tested and got a resonable result from Doctrine::getTable('BlogPost')->getPopularTags()?

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Fabien Pennequin
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: