{"action":"created","issue":{"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/818","labels_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/818/labels{/name}","comments_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/818/comments","events_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/818/events","html_url":"https://github.com/sonata-project/SonataMediaBundle/issues/818","id":96561568,"number":818,"title":"Check whether the model classes exists","user":{"login":"pyrech","id":2021641,"avatar_url":"https://avatars.githubusercontent.com/u/2021641?v=3","gravatar_id":"","url":"https://api.github.com/users/pyrech","html_url":"https://github.com/pyrech","followers_url":"https://api.github.com/users/pyrech/followers","following_url":"https://api.github.com/users/pyrech/following{/other_user}","gists_url":"https://api.github.com/users/pyrech/gists{/gist_id}","starred_url":"https://api.github.com/users/pyrech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyrech/subscriptions","organizations_url":"https://api.github.com/users/pyrech/orgs","repos_url":"https://api.github.com/users/pyrech/repos","events_url":"https://api.github.com/users/pyrech/events{/privacy}","received_events_url":"https://api.github.com/users/pyrech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-07-22T12:55:09Z","updated_at":"2015-07-22T20:28:55Z","closed_at":null,"body":"Hi,\r\n\r\nIn several sonata bundles (at least SonataMedia and SonataClassification), the config need to specify model classes with the `class` parameter.\r\n\r\nFor example (in config.yml):\r\n```yaml\r\n\r\nsonata_media:\r\n    # if you don't use default namespace configuration\r\n    class:\r\n        media:             AppBundle\\Entity\\Media\\Media\r\n        gallery:           AppBundle\\Entity\\Media\\Gallery\r\n        gallery_has_media: AppBundle\\Entity\\Media\\GalleryHasMedia\r\n        category:          AppBundle\\Entity\\Classification\\Category\r\n```\r\n\r\nHowever, if a specified class doesn't exist (f.e. typo or wrong copy/paste), some wtf problems can happen anywhere in the application (because some metadata are wrong and then some relations / tables are not created) without obvious reasons.\r\n\r\nI propose to add a check on `DependencyInjection\\Configuration` to ensure the specified classes exist. Do you agree with this? If yes I could eventually make a PR for all the bundles using the `class` configuration"},"comment":{"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/comments/123852697","html_url":"https://github.com/sonata-project/SonataMediaBundle/issues/818#issuecomment-123852697","issue_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/818","id":123852697,"user":{"login":"pyrech","id":2021641,"avatar_url":"https://avatars.githubusercontent.com/u/2021641?v=3","gravatar_id":"","url":"https://api.github.com/users/pyrech","html_url":"https://github.com/pyrech","followers_url":"https://api.github.com/users/pyrech/followers","following_url":"https://api.github.com/users/pyrech/following{/other_user}","gists_url":"https://api.github.com/users/pyrech/gists{/gist_id}","starred_url":"https://api.github.com/users/pyrech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyrech/subscriptions","organizations_url":"https://api.github.com/users/pyrech/orgs","repos_url":"https://api.github.com/users/pyrech/repos","events_url":"https://api.github.com/users/pyrech/events{/privacy}","received_events_url":"https://api.github.com/users/pyrech/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T20:28:55Z","updated_at":"2015-07-22T20:28:55Z","body":"Here it is: #820 :)\r\n\r\nIf you valid this PR, others PRs should be made to:\r\n- sonata-media 2.4 to add the check on category\r\n- sonata-classification 2.2\r\n- sonata-classification master (context was added)\r\n- sonata-page 2.3\r\n- sonata-news 2.2\r\n- sonata-news master (looks like tag and category where changed to tag and collection from sonata-classification)\r\n- sonata-user 2.2\r\n- sonata-notification 2.2\r\n- sonata-comment master\r\n- sonata-timeline master"}}