{"id":17226807,"url":"https://github.com/dantleech/phpcrtaxonomybundle","last_synced_at":"2025-04-14T01:12:56.314Z","repository":{"id":12887185,"uuid":"15563817","full_name":"dantleech/PhpcrTaxonomyBundle","owner":"dantleech","description":"Taxonomy Bundle for PHPCR","archived":false,"fork":false,"pushed_at":"2015-01-25T09:00:11.000Z","size":223,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T01:12:45.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dantleech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-01T12:13:32.000Z","updated_at":"2015-07-24T09:35:53.000Z","dependencies_parsed_at":"2022-08-27T10:40:32.945Z","dependency_job_id":null,"html_url":"https://github.com/dantleech/PhpcrTaxonomyBundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantleech%2FPhpcrTaxonomyBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantleech%2FPhpcrTaxonomyBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantleech%2FPhpcrTaxonomyBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantleech%2FPhpcrTaxonomyBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dantleech","download_url":"https://codeload.github.com/dantleech/PhpcrTaxonomyBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804825,"owners_count":21164135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T04:17:16.829Z","updated_at":"2025-04-14T01:12:56.294Z","avatar_url":"https://github.com/dantleech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHPCR Taxonomy Bundle\n=====================\n\n[![Build Status](https://secure.travis-ci.org/dantleech/PhpcrTaxonomyBundle.png)](http://travis-ci.org/dantleech/PhpcrTaxonomyBundle)\n[![Latest Stable Version](https://poser.pugx.org/dantleech/phpcr-taxonomy-bundle/version.png)](https://packagist.org/packages/dantleech/phpcr-taxonomy-bundle)\n[![Total Downloads](https://poser.pugx.org/dantleech/phpcr-taxonomy-bundle/d/total.png)](https://packagist.org/packages/dantleech/phpcr-taxonomy-bundle)\n\nWhat works:\n\n- Automatically creating tag objects at spsecified paths\n  - Paths effectively act as taxonomies\n- Automatic tag object association with target document\n- Taxon referrer count, because PHPCR-ODM doesn't do aggregation. (for tag clouds for example)\n- Command to \"fix\" or initialize taxon referrer counts\n\nWhat is planned:\n\n- Orphan removal\n- Static taxonomies - i.e. specify if new taxons can be created.\n- Hierachical tagging, e.g. specify \"Laptops \u003e Levono \u003e X200\" as a tag,\n  creating a 3 level heierachy.\n\nThis is a very specific taxonomy bundle for PHPCR.\n\nBasic Usage\n-----------\n\nFor each document you wish to be tagged you need to add two property annotations, \n`@Taxons` and `@TaxonObjects`. The first will automatically be mapped to an\narray, the second will contain a collection of the actual taxon objects.\n\n````php\nnamespace DTL\\PhpcrTaxonomyBundle\\Tests\\Resources\\Document;\n\nuse Doctrine\\ODM\\PHPCR\\Mapping\\Annotations as PHPCR;\nuse DTL\\PhpcrTaxonomyBundle\\Metadata\\Annotations as PhpcrTaxonomy;\n\n/**\n * @PHPCR\\Document(referenceable=true)\n */\nclass Post\n{\n    /**\n     * @PHPCR\\Id()\n     */\n    public $id;\n\n    /**\n     * @PHPCR\\ParentDocument()\n     */\n    public $parent;\n\n    /**\n     * @PhpcrTaxonomy\\Taxons(path=\"/test/taxons\")\n     */\n    public $tags;\n\n    /**\n     * @PhpcrTaxonomy\\TaxonObjects()\n     */\n    public $tagObjects;\n}\n````\n\nTags can be set as follows:\n\n````php\n$post = new Post();\n$post-\u003etags = array('one', 'two');\n````\n\nThe parent document for each taxon is determined by the `path` property of the\n`Taxons` annotation. It must exist before persisting the document.\n\nAlternative Taxon Classes\n-------------------------\n\nYou can specify an alternative taxon class as follows:\n\n````php\nnamespace DTL\\PhpcrTaxonomyBundle\\Tests\\Resources\\Document;\n\nuse Doctrine\\ODM\\PHPCR\\Mapping\\Annotations as PHPCR;\nuse DTL\\PhpcrTaxonomyBundle\\Metadata\\Annotations as PhpcrTaxonomy;\n\n/**\n * @PHPCR\\Document(referenceable=true)\n */\nclass Post\n{\n    // ...\n\n    /**\n     * @PhpcrTaxonomy\\Taxons(path=\"/test/taxons\", taxonClass=\"MyBundle\\MyTaxonClass\")\n     */\n    public $tags;\n}\n````\n\nTaxon Referrer Count\n--------------------\n\nThe Doctrine subscriber automatically records the number of referrers each\ntaxon document has. For example if a taxon is used by 5 posts, then that taxon\nhas 5 referrers.\n\nThis is especially useful if you want to show a tag cloud which weights taxons\nby the number of times that they are referenced.\n\nNote that if you implement a custom taxon document you must implement both\n`getReferrerCount` and `setReferrerCount` and store the field as a `Long`.\n\nThe taxon referrer count for each taxon is updated whenever a taxon is\nassociated or disassociated with a document. If for some reason this data\nbecomes corrupted you can launch the following command to reinitialize this\ndata:\n\n````bash\n$ php app/console phpcr-taxonomy:update-referrer-count\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantleech%2Fphpcrtaxonomybundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdantleech%2Fphpcrtaxonomybundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantleech%2Fphpcrtaxonomybundle/lists"}