{"action":"created","comment":{"url":"https://api.github.com/repos/Kdyby/Translation/pulls/comments/38815096","id":38815096,"diff_hunk":"@@ -0,0 +1,111 @@\n+<?php\n+\n+/**\n+ * This file is part of the Kdyby (http://www.kdyby.org)\n+ *\n+ * Copyright (c) 2008 Filip Procházka (filip@prochazka.su)\n+ *\n+ * For the full copyright and license information, please view the file license.txt that was distributed with this source code.\n+ */\n+\n+namespace Kdyby\\Translation\\Console;\n+\n+use Doctrine\\DBAL\\Connection;\n+use Doctrine\\DBAL\\Schema\\AbstractSchemaManager;\n+use Doctrine\\DBAL\\Types\\Type;\n+use Kdyby;\n+use Nette;\n+use Symfony\\Component\\Console\\Command\\Command;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Input\\InputOption;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+\n+\n+\n+/**\n+ * @author Filip Procházka <filip@prochazka.su>\n+ */\n+class CreateTableCommand extends Command\n+{\n+\n+\t/** @var Nette\\DI\\Container */\n+\tprivate $serviceLocator;\n+\n+\t/** @var Connection */\n+\tprivate $connection;\n+\n+\t/** @var AbstractSchemaManager */\n+\tprivate $schemaManager;\n+\n+\t/** @var string */\n+\tpublic $table;\n+\n+\t/** @var string */\n+\tpublic $key;\n+\n+\t/** @var string */\n+\tpublic $locale;\n+\n+\t/** @var string */\n+\tpublic $message;\n+\n+\t/** @var string */\n+\tpublic $updatedAt;\n+\n+\tprotected function configure()\n+\t{\n+\t\t$this->setName('kdyby:translation-create-table')\n+\t\t\t->setDescription('Builds query for creating of database table.')\n+\t\t\t->setDefinition(array(\n+\t\t\t\tnew InputOption(\n+\t\t\t\t\t'dump-sql', null, InputOption::VALUE_NONE,\n+\t\t\t\t\t'Dumps the generated SQL statement to the screen (does not execute it).'\n+\t\t\t\t),\n+\t\t\t\tnew InputOption(\n+\t\t\t\t\t'force', null, InputOption::VALUE_NONE,\n+\t\t\t\t\t'Causes the generated SQL statement to be physically executed against your database.'\n+\t\t\t\t)\n+\t\t\t));\n+\t}\n+\n+\n+\tprotected function initialize(InputInterface $input, OutputInterface $output)\n+\t{\n+\t\t$this->serviceLocator = $this->getHelper('container')->getContainer();\n+\t\t$this->connection = $this->serviceLocator->getByType('Doctrine\\DBAL\\Connection');\n+\t\t$this->schemaManager = $this->serviceLocator->getByType('Doctrine\\DBAL\\Schema\\AbstractSchemaManager');\n+\t}\n+\n+\n+\tprotected function execute(InputInterface $input, OutputInterface $output)\n+\t{\n+\t\tif (!$input->getOption('dump-sql') && !$input->getOption('force')) {\n+\t\t\t$output->writeln('<error>You must run the command either with --dump-sql or --force.</error>');\n+\t\t\treturn 0;\n+\t\t}\n+\n+\t\tif (!$this->schemaManager->tablesExist($this->table)) {","path":"src/Kdyby/Translation/Console/CreateTableCommand.php","position":87,"original_position":87,"commit_id":"9f7fa0728f410550726eb204f4710fd4a35eacd6","original_commit_id":"9f7fa0728f410550726eb204f4710fd4a35eacd6","user":{"login":"fprochazka","id":158625,"avatar_url":"https://avatars.githubusercontent.com/u/158625?v=3","gravatar_id":"","url":"https://api.github.com/users/fprochazka","html_url":"https://github.com/fprochazka","followers_url":"https://api.github.com/users/fprochazka/followers","following_url":"https://api.github.com/users/fprochazka/following{/other_user}","gists_url":"https://api.github.com/users/fprochazka/gists{/gist_id}","starred_url":"https://api.github.com/users/fprochazka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fprochazka/subscriptions","organizations_url":"https://api.github.com/users/fprochazka/orgs","repos_url":"https://api.github.com/users/fprochazka/repos","events_url":"https://api.github.com/users/fprochazka/events{/privacy}","received_events_url":"https://api.github.com/users/fprochazka/received_events","type":"User","site_admin":false},"body":"rozhodně je lepší utnout to hned a vyhodit chybu, aby se nemuselo odsazovat 90% metody","created_at":"2015-09-05T21:48:11Z","updated_at":"2015-09-05T21:48:11Z","html_url":"https://github.com/Kdyby/Translation/pull/86#discussion_r38815096","pull_request_url":"https://api.github.com/repos/Kdyby/Translation/pulls/86","_links":{"self":{"href":"https://api.github.com/repos/Kdyby/Translation/pulls/comments/38815096"},"html":{"href":"https://github.com/Kdyby/Translation/pull/86#discussion_r38815096"},"pull_request":{"href":"https://api.github.com/repos/Kdyby/Translation/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/Kdyby/Translation/pulls/86","id":43698852,"html_url":"https://github.com/Kdyby/Translation/pull/86","diff_url":"https://github.com/Kdyby/Translation/pull/86.diff","patch_url":"https://github.com/Kdyby/Translation/pull/86.patch","issue_url":"https://api.github.com/repos/Kdyby/Translation/issues/86","number":86,"state":"open","locked":false,"title":"Added loaders and dumpers for nette database and Doctrine DBAL.","user":{"login":"racinmat","id":5525771,"avatar_url":"https://avatars.githubusercontent.com/u/5525771?v=3","gravatar_id":"","url":"https://api.github.com/users/racinmat","html_url":"https://github.com/racinmat","followers_url":"https://api.github.com/users/racinmat/followers","following_url":"https://api.github.com/users/racinmat/following{/other_user}","gists_url":"https://api.github.com/users/racinmat/gists{/gist_id}","starred_url":"https://api.github.com/users/racinmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racinmat/subscriptions","organizations_url":"https://api.github.com/users/racinmat/orgs","repos_url":"https://api.github.com/users/racinmat/repos","events_url":"https://api.github.com/users/racinmat/events{/privacy}","received_events_url":"https://api.github.com/users/racinmat/received_events","type":"User","site_admin":false},"body":"Added intergration of translations stored in database using doctrine DBAL and nette database.","created_at":"2015-08-29T17:57:04Z","updated_at":"2015-09-05T21:48:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"668f0ffaa42e3266167fd6d926ea06d2d513b361","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Kdyby/Translation/pulls/86/commits","review_comments_url":"https://api.github.com/repos/Kdyby/Translation/pulls/86/comments","review_comment_url":"https://api.github.com/repos/Kdyby/Translation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kdyby/Translation/issues/86/comments","statuses_url":"https://api.github.com/repos/Kdyby/Translation/statuses/9f7fa0728f410550726eb204f4710fd4a35eacd6","head":{"label":"XcoreCMS:master","ref":"master","sha":"9f7fa0728f410550726eb204f4710fd4a35eacd6","user":{"login":"XcoreCMS","id":9268429,"avatar_url":"https://avatars.githubusercontent.com/u/9268429?v=3","gravatar_id":"","url":"https://api.github.com/users/XcoreCMS","html_url":"https://github.com/XcoreCMS","followers_url":"https://api.github.com/users/XcoreCMS/followers","following_url":"https://api.github.com/users/XcoreCMS/following{/other_user}","gists_url":"https://api.github.com/users/XcoreCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/XcoreCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XcoreCMS/subscriptions","organizations_url":"https://api.github.com/users/XcoreCMS/orgs","repos_url":"https://api.github.com/users/XcoreCMS/repos","events_url":"https://api.github.com/users/XcoreCMS/events{/privacy}","received_events_url":"https://api.github.com/users/XcoreCMS/received_events","type":"Organization","site_admin":false},"repo":{"id":41297581,"name":"Translation","full_name":"XcoreCMS/Translation","owner":{"login":"XcoreCMS","id":9268429,"avatar_url":"https://avatars.githubusercontent.com/u/9268429?v=3","gravatar_id":"","url":"https://api.github.com/users/XcoreCMS","html_url":"https://github.com/XcoreCMS","followers_url":"https://api.github.com/users/XcoreCMS/followers","following_url":"https://api.github.com/users/XcoreCMS/following{/other_user}","gists_url":"https://api.github.com/users/XcoreCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/XcoreCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XcoreCMS/subscriptions","organizations_url":"https://api.github.com/users/XcoreCMS/orgs","repos_url":"https://api.github.com/users/XcoreCMS/repos","events_url":"https://api.github.com/users/XcoreCMS/events{/privacy}","received_events_url":"https://api.github.com/users/XcoreCMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/XcoreCMS/Translation","description":"Integration of Symfony/Translation into Nette Framework","fork":true,"url":"https://api.github.com/repos/XcoreCMS/Translation","forks_url":"https://api.github.com/repos/XcoreCMS/Translation/forks","keys_url":"https://api.github.com/repos/XcoreCMS/Translation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XcoreCMS/Translation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XcoreCMS/Translation/teams","hooks_url":"https://api.github.com/repos/XcoreCMS/Translation/hooks","issue_events_url":"https://api.github.com/repos/XcoreCMS/Translation/issues/events{/number}","events_url":"https://api.github.com/repos/XcoreCMS/Translation/events","assignees_url":"https://api.github.com/repos/XcoreCMS/Translation/assignees{/user}","branches_url":"https://api.github.com/repos/XcoreCMS/Translation/branches{/branch}","tags_url":"https://api.github.com/repos/XcoreCMS/Translation/tags","blobs_url":"https://api.github.com/repos/XcoreCMS/Translation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XcoreCMS/Translation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XcoreCMS/Translation/git/refs{/sha}","trees_url":"https://api.github.com/repos/XcoreCMS/Translation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XcoreCMS/Translation/statuses/{sha}","languages_url":"https://api.github.com/repos/XcoreCMS/Translation/languages","stargazers_url":"https://api.github.com/repos/XcoreCMS/Translation/stargazers","contributors_url":"https://api.github.com/repos/XcoreCMS/Translation/contributors","subscribers_url":"https://api.github.com/repos/XcoreCMS/Translation/subscribers","subscription_url":"https://api.github.com/repos/XcoreCMS/Translation/subscription","commits_url":"https://api.github.com/repos/XcoreCMS/Translation/commits{/sha}","git_commits_url":"https://api.github.com/repos/XcoreCMS/Translation/git/commits{/sha}","comments_url":"https://api.github.com/repos/XcoreCMS/Translation/comments{/number}","issue_comment_url":"https://api.github.com/repos/XcoreCMS/Translation/issues/comments{/number}","contents_url":"https://api.github.com/repos/XcoreCMS/Translation/contents/{+path}","compare_url":"https://api.github.com/repos/XcoreCMS/Translation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XcoreCMS/Translation/merges","archive_url":"https://api.github.com/repos/XcoreCMS/Translation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XcoreCMS/Translation/downloads","issues_url":"https://api.github.com/repos/XcoreCMS/Translation/issues{/number}","pulls_url":"https://api.github.com/repos/XcoreCMS/Translation/pulls{/number}","milestones_url":"https://api.github.com/repos/XcoreCMS/Translation/milestones{/number}","notifications_url":"https://api.github.com/repos/XcoreCMS/Translation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XcoreCMS/Translation/labels{/name}","releases_url":"https://api.github.com/repos/XcoreCMS/Translation/releases{/id}","created_at":"2015-08-24T10:40:02Z","updated_at":"2015-08-24T10:40:02Z","pushed_at":"2015-09-05T21:17:29Z","git_url":"git://github.com/XcoreCMS/Translation.git","ssh_url":"git@github.com:XcoreCMS/Translation.git","clone_url":"https://github.com/XcoreCMS/Translation.git","svn_url":"https://github.com/XcoreCMS/Translation","homepage":"https://packagist.org/packages/kdyby/translation","size":514,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Kdyby:master","ref":"master","sha":"95ea30618cfc7b736ffc071b27ded0445e21dd40","user":{"login":"Kdyby","id":615853,"avatar_url":"https://avatars.githubusercontent.com/u/615853?v=3","gravatar_id":"","url":"https://api.github.com/users/Kdyby","html_url":"https://github.com/Kdyby","followers_url":"https://api.github.com/users/Kdyby/followers","following_url":"https://api.github.com/users/Kdyby/following{/other_user}","gists_url":"https://api.github.com/users/Kdyby/gists{/gist_id}","starred_url":"https://api.github.com/users/Kdyby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kdyby/subscriptions","organizations_url":"https://api.github.com/users/Kdyby/orgs","repos_url":"https://api.github.com/users/Kdyby/repos","events_url":"https://api.github.com/users/Kdyby/events{/privacy}","received_events_url":"https://api.github.com/users/Kdyby/received_events","type":"Organization","site_admin":false},"repo":{"id":8676253,"name":"Translation","full_name":"Kdyby/Translation","owner":{"login":"Kdyby","id":615853,"avatar_url":"https://avatars.githubusercontent.com/u/615853?v=3","gravatar_id":"","url":"https://api.github.com/users/Kdyby","html_url":"https://github.com/Kdyby","followers_url":"https://api.github.com/users/Kdyby/followers","following_url":"https://api.github.com/users/Kdyby/following{/other_user}","gists_url":"https://api.github.com/users/Kdyby/gists{/gist_id}","starred_url":"https://api.github.com/users/Kdyby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kdyby/subscriptions","organizations_url":"https://api.github.com/users/Kdyby/orgs","repos_url":"https://api.github.com/users/Kdyby/repos","events_url":"https://api.github.com/users/Kdyby/events{/privacy}","received_events_url":"https://api.github.com/users/Kdyby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kdyby/Translation","description":"Integration of Symfony/Translation into Nette Framework","fork":false,"url":"https://api.github.com/repos/Kdyby/Translation","forks_url":"https://api.github.com/repos/Kdyby/Translation/forks","keys_url":"https://api.github.com/repos/Kdyby/Translation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kdyby/Translation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kdyby/Translation/teams","hooks_url":"https://api.github.com/repos/Kdyby/Translation/hooks","issue_events_url":"https://api.github.com/repos/Kdyby/Translation/issues/events{/number}","events_url":"https://api.github.com/repos/Kdyby/Translation/events","assignees_url":"https://api.github.com/repos/Kdyby/Translation/assignees{/user}","branches_url":"https://api.github.com/repos/Kdyby/Translation/branches{/branch}","tags_url":"https://api.github.com/repos/Kdyby/Translation/tags","blobs_url":"https://api.github.com/repos/Kdyby/Translation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kdyby/Translation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kdyby/Translation/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kdyby/Translation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kdyby/Translation/statuses/{sha}","languages_url":"https://api.github.com/repos/Kdyby/Translation/languages","stargazers_url":"https://api.github.com/repos/Kdyby/Translation/stargazers","contributors_url":"https://api.github.com/repos/Kdyby/Translation/contributors","subscribers_url":"https://api.github.com/repos/Kdyby/Translation/subscribers","subscription_url":"https://api.github.com/repos/Kdyby/Translation/subscription","commits_url":"https://api.github.com/repos/Kdyby/Translation/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kdyby/Translation/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kdyby/Translation/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kdyby/Translation/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kdyby/Translation/contents/{+path}","compare_url":"https://api.github.com/repos/Kdyby/Translation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kdyby/Translation/merges","archive_url":"https://api.github.com/repos/Kdyby/Translation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kdyby/Translation/downloads","issues_url":"https://api.github.com/repos/Kdyby/Translation/issues{/number}","pulls_url":"https://api.github.com/repos/Kdyby/Translation/pulls{/number}","milestones_url":"https://api.github.com/repos/Kdyby/Translation/milestones{/number}","notifications_url":"https://api.github.com/repos/Kdyby/Translation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kdyby/Translation/labels{/name}","releases_url":"https://api.github.com/repos/Kdyby/Translation/releases{/id}","created_at":"2013-03-09T21:13:42Z","updated_at":"2015-09-05T18:36:40Z","pushed_at":"2015-09-05T21:17:30Z","git_url":"git://github.com/Kdyby/Translation.git","ssh_url":"git@github.com:Kdyby/Translation.git","clone_url":"https://github.com/Kdyby/Translation.git","svn_url":"https://github.com/Kdyby/Translation","homepage":"https://packagist.org/packages/kdyby/translation","size":2495,"stargazers_count":49,"watchers_count":49,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":28,"forks":26,"open_issues":28,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kdyby/Translation/pulls/86"},"html":{"href":"https://github.com/Kdyby/Translation/pull/86"},"issue":{"href":"https://api.github.com/repos/Kdyby/Translation/issues/86"},"comments":{"href":"https://api.github.com/repos/Kdyby/Translation/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/Kdyby/Translation/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/Kdyby/Translation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kdyby/Translation/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/Kdyby/Translation/statuses/9f7fa0728f410550726eb204f4710fd4a35eacd6"}}}}