{"action":"created","comment":{"url":"https://api.github.com/repos/phphants/phph-site/pulls/comments/79065648","id":79065648,"diff_hunk":"@@ -3,201 +3,134 @@\n \n namespace App\\Entity;\n \n+use Doctrine\\Common\\Collections\\Collection;\n+use Doctrine\\ORM\\Mapping as ORM;\n use DateTimeImmutable;\n-\n-class Meetup\n+use Doctrine\\Common\\Collections\\ArrayCollection;\n+use Ramsey\\Uuid\\Uuid;\n+\n+/**\n+ * @ORM\\Entity\n+ * @ORM\\Table(name=\"meetup\")\n+ */\n+/*final */class Meetup\n {\n     /**\n-     * @var int\n+     * @ORM\\Id\n+     * @ORM\\Column(name=\"id\", type=\"guid\")\n+     * @ORM\\GeneratedValue(strategy=\"NONE\")\n+     * @var string\n      */\n     private $id;\n \n     /**\n+     * @ORM\\Column(name=\"from_date\", type=\"datetime\", nullable=false)\n      * @var DateTimeImmutable\n      */\n     private $fromDate;\n \n     /**\n+     * @ORM\\Column(name=\"to_date\", type=\"datetime\", nullable=false)\n      * @var DateTimeImmutable\n      */\n     private $toDate;\n \n     /**\n-     * @var string\n+     * @ORM\\OneToOne(targetEntity=EventbriteData::class, mappedBy=\"meetup\")\n+     * @var EventbriteData\n      */\n-    private $registrationUrl;\n+    private $eventbriteData;\n \n     /**\n-     * @var string\n-     */\n-    private $locationUrl;\n-\n-    /**\n-     * @var string\n+     * @ORM\\ManyToOne(targetEntity=Location::class)\n+     * @ORM\\JoinColumn(name=\"location_id\", referencedColumnName=\"id\", nullable=false)\n+     * @var Location\n      */\n     private $location;\n \n     /**\n+     * @ORM\\Column(name=\"topic\", type=\"string\", length=1024, nullable=true)\n      * @var string\n      */\n     private $topic;\n \n     /**\n-     * @var Talk[]|string[]\n-     */\n-    private $talkingPoints = [];\n-\n-    /**\n-     * @var string\n+     * @ORM\\OneToMany(targetEntity=Talk::class, mappedBy=\"meetup\")\n+     * @ORM\\OrderBy({\"time\" = \"ASC\"})\n+     * @var ArrayCollection|Talk[]\n      */\n-    private $widget;\n-\n-    /**\n-     * @var Schedule[]\n-     */\n-    private $schedule = [];\n-\n-    public function __construct()\n-    {\n-        $this->schedule = [];\n-    }\n+    private $talks;\n \n-    public function exchangeArray($data) : array\n+    private function __construct()\n     {\n-        throw new \\Exception('Not implemented yet...');\n-    }\n-\n-    public function setId(int $id) : self\n-    {\n-        $this->id = $id;\n-\n-        return $this;\n+        $this->id = Uuid::uuid4();\n+        $this->talks = new ArrayCollection();\n     }\n \n     /**\n-     * @return int\n+     * @param DateTimeImmutable $from\n+     * @param DateTimeImmutable $to\n+     * @param Location $location\n+     * @param Talk[] $talks\n+     * @param string $topic\n+     * @return Meetup\n+     * @throws \\InvalidArgumentException\n      */\n-    public function getId() : int\n-    {\n-        return $this->id;\n-    }\n-\n-    public function setFromDate(DateTimeImmutable $date) : self\n-    {\n-        $this->fromDate = $date;\n+    public static function fromStandardMeetup(\n+        DateTimeImmutable $from,\n+        DateTimeImmutable $to,\n+        Location $location,\n+        array $talks,\n+        string $topic = null\n+    ) : self {\n+        $meetup = new self();\n+        $meetup->fromDate = $from;\n+        $meetup->toDate = $to;\n+        $meetup->location = $location;\n+        $meetup->topic = $topic;\n \n-        return $this;\n+        foreach ($talks as $k => $talk) {\n+            if (!$talk instanceof Talk) {\n+                throw new \\InvalidArgumentException(sprintf('Item with key %s in talks was not a Talk', $k));\n+            }\n+            $meetup->talks->add($talk);\n+        }\n+        return $meetup;\n     }\n \n-    /**\n-     * @return DateTimeImmutable\n-     */\n-    public function getFromDate() : DateTimeImmutable\n+    public function getFromDate() : \\DateTimeImmutable\n     {\n-        return $this->fromDate;\n+        return new \\DateTimeImmutable($this->fromDate->format('Y-m-d H:i:s'));","path":"src/App/Entity/Meetup.php","position":153,"original_position":153,"commit_id":"931cdcd4c9b98b127fc51169b74895ee349c2053","original_commit_id":"872ecc2b658a778a76a373e721565d094928cd9f","user":{"login":"asgrim","id":496145,"avatar_url":"https://avatars.githubusercontent.com/u/496145?v=3","gravatar_id":"","url":"https://api.github.com/users/asgrim","html_url":"https://github.com/asgrim","followers_url":"https://api.github.com/users/asgrim/followers","following_url":"https://api.github.com/users/asgrim/following{/other_user}","gists_url":"https://api.github.com/users/asgrim/gists{/gist_id}","starred_url":"https://api.github.com/users/asgrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asgrim/subscriptions","organizations_url":"https://api.github.com/users/asgrim/orgs","repos_url":"https://api.github.com/users/asgrim/repos","events_url":"https://api.github.com/users/asgrim/events{/privacy}","received_events_url":"https://api.github.com/users/asgrim/received_events","type":"User","site_admin":false},"body":"Well, not wrong place","created_at":"2016-09-15T21:26:29Z","updated_at":"2016-09-15T21:26:29Z","html_url":"https://github.com/phphants/phph-site/pull/112#discussion_r79065648","pull_request_url":"https://api.github.com/repos/phphants/phph-site/pulls/112","_links":{"self":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/comments/79065648"},"html":{"href":"https://github.com/phphants/phph-site/pull/112#discussion_r79065648"},"pull_request":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/112"}}},"pull_request":{"url":"https://api.github.com/repos/phphants/phph-site/pulls/112","id":84754831,"html_url":"https://github.com/phphants/phph-site/pull/112","diff_url":"https://github.com/phphants/phph-site/pull/112.diff","patch_url":"https://github.com/phphants/phph-site/pull/112.patch","issue_url":"https://api.github.com/repos/phphants/phph-site/issues/112","number":112,"state":"open","locked":false,"title":"Move meetups to database","user":{"login":"asgrim","id":496145,"avatar_url":"https://avatars.githubusercontent.com/u/496145?v=3","gravatar_id":"","url":"https://api.github.com/users/asgrim","html_url":"https://github.com/asgrim","followers_url":"https://api.github.com/users/asgrim/followers","following_url":"https://api.github.com/users/asgrim/following{/other_user}","gists_url":"https://api.github.com/users/asgrim/gists{/gist_id}","starred_url":"https://api.github.com/users/asgrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asgrim/subscriptions","organizations_url":"https://api.github.com/users/asgrim/orgs","repos_url":"https://api.github.com/users/asgrim/repos","events_url":"https://api.github.com/users/asgrim/events{/privacy}","received_events_url":"https://api.github.com/users/asgrim/received_events","type":"User","site_admin":false},"body":"Fixes #100 - introduces DB-stored talks & related metadata.\r\n\r\n * [x] Needs #96 to be merged - rebase onto `master` once merged\r\n * [x] Migrate all entities to use Doctrine\r\n * [x] Rewrite MeetupsService to use Doctrine\r\n * [x] Create SQL for: 2011\r\n * [x] Create SQL for: 2012\r\n * [x] Create SQL for: 2013\r\n * [x] Create SQL for: 2014\r\n * [x] Create SQL for: 2015\r\n * [x] Create SQL for: 2016","created_at":"2016-09-10T12:58:42Z","updated_at":"2016-09-15T21:26:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f854bbcc6cef850c516e4d11a05f0fd140774f49","assignee":{"login":"lboynton","id":98873,"avatar_url":"https://avatars.githubusercontent.com/u/98873?v=3","gravatar_id":"","url":"https://api.github.com/users/lboynton","html_url":"https://github.com/lboynton","followers_url":"https://api.github.com/users/lboynton/followers","following_url":"https://api.github.com/users/lboynton/following{/other_user}","gists_url":"https://api.github.com/users/lboynton/gists{/gist_id}","starred_url":"https://api.github.com/users/lboynton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lboynton/subscriptions","organizations_url":"https://api.github.com/users/lboynton/orgs","repos_url":"https://api.github.com/users/lboynton/repos","events_url":"https://api.github.com/users/lboynton/events{/privacy}","received_events_url":"https://api.github.com/users/lboynton/received_events","type":"User","site_admin":false},"assignees":[{"login":"lboynton","id":98873,"avatar_url":"https://avatars.githubusercontent.com/u/98873?v=3","gravatar_id":"","url":"https://api.github.com/users/lboynton","html_url":"https://github.com/lboynton","followers_url":"https://api.github.com/users/lboynton/followers","following_url":"https://api.github.com/users/lboynton/following{/other_user}","gists_url":"https://api.github.com/users/lboynton/gists{/gist_id}","starred_url":"https://api.github.com/users/lboynton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lboynton/subscriptions","organizations_url":"https://api.github.com/users/lboynton/orgs","repos_url":"https://api.github.com/users/lboynton/repos","events_url":"https://api.github.com/users/lboynton/events{/privacy}","received_events_url":"https://api.github.com/users/lboynton/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/phphants/phph-site/pulls/112/commits","review_comments_url":"https://api.github.com/repos/phphants/phph-site/pulls/112/comments","review_comment_url":"https://api.github.com/repos/phphants/phph-site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phphants/phph-site/issues/112/comments","statuses_url":"https://api.github.com/repos/phphants/phph-site/statuses/931cdcd4c9b98b127fc51169b74895ee349c2053","head":{"label":"asgrim:move-meetups-to-database","ref":"move-meetups-to-database","sha":"931cdcd4c9b98b127fc51169b74895ee349c2053","user":{"login":"asgrim","id":496145,"avatar_url":"https://avatars.githubusercontent.com/u/496145?v=3","gravatar_id":"","url":"https://api.github.com/users/asgrim","html_url":"https://github.com/asgrim","followers_url":"https://api.github.com/users/asgrim/followers","following_url":"https://api.github.com/users/asgrim/following{/other_user}","gists_url":"https://api.github.com/users/asgrim/gists{/gist_id}","starred_url":"https://api.github.com/users/asgrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asgrim/subscriptions","organizations_url":"https://api.github.com/users/asgrim/orgs","repos_url":"https://api.github.com/users/asgrim/repos","events_url":"https://api.github.com/users/asgrim/events{/privacy}","received_events_url":"https://api.github.com/users/asgrim/received_events","type":"User","site_admin":false},"repo":{"id":6633683,"name":"phph-site","full_name":"asgrim/phph-site","owner":{"login":"asgrim","id":496145,"avatar_url":"https://avatars.githubusercontent.com/u/496145?v=3","gravatar_id":"","url":"https://api.github.com/users/asgrim","html_url":"https://github.com/asgrim","followers_url":"https://api.github.com/users/asgrim/followers","following_url":"https://api.github.com/users/asgrim/following{/other_user}","gists_url":"https://api.github.com/users/asgrim/gists{/gist_id}","starred_url":"https://api.github.com/users/asgrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asgrim/subscriptions","organizations_url":"https://api.github.com/users/asgrim/orgs","repos_url":"https://api.github.com/users/asgrim/repos","events_url":"https://api.github.com/users/asgrim/events{/privacy}","received_events_url":"https://api.github.com/users/asgrim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/asgrim/phph-site","description":"Website for www.phphants.co.uk","fork":true,"url":"https://api.github.com/repos/asgrim/phph-site","forks_url":"https://api.github.com/repos/asgrim/phph-site/forks","keys_url":"https://api.github.com/repos/asgrim/phph-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asgrim/phph-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asgrim/phph-site/teams","hooks_url":"https://api.github.com/repos/asgrim/phph-site/hooks","issue_events_url":"https://api.github.com/repos/asgrim/phph-site/issues/events{/number}","events_url":"https://api.github.com/repos/asgrim/phph-site/events","assignees_url":"https://api.github.com/repos/asgrim/phph-site/assignees{/user}","branches_url":"https://api.github.com/repos/asgrim/phph-site/branches{/branch}","tags_url":"https://api.github.com/repos/asgrim/phph-site/tags","blobs_url":"https://api.github.com/repos/asgrim/phph-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asgrim/phph-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asgrim/phph-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/asgrim/phph-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asgrim/phph-site/statuses/{sha}","languages_url":"https://api.github.com/repos/asgrim/phph-site/languages","stargazers_url":"https://api.github.com/repos/asgrim/phph-site/stargazers","contributors_url":"https://api.github.com/repos/asgrim/phph-site/contributors","subscribers_url":"https://api.github.com/repos/asgrim/phph-site/subscribers","subscription_url":"https://api.github.com/repos/asgrim/phph-site/subscription","commits_url":"https://api.github.com/repos/asgrim/phph-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/asgrim/phph-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/asgrim/phph-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/asgrim/phph-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/asgrim/phph-site/contents/{+path}","compare_url":"https://api.github.com/repos/asgrim/phph-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asgrim/phph-site/merges","archive_url":"https://api.github.com/repos/asgrim/phph-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asgrim/phph-site/downloads","issues_url":"https://api.github.com/repos/asgrim/phph-site/issues{/number}","pulls_url":"https://api.github.com/repos/asgrim/phph-site/pulls{/number}","milestones_url":"https://api.github.com/repos/asgrim/phph-site/milestones{/number}","notifications_url":"https://api.github.com/repos/asgrim/phph-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asgrim/phph-site/labels{/name}","releases_url":"https://api.github.com/repos/asgrim/phph-site/releases{/id}","deployments_url":"https://api.github.com/repos/asgrim/phph-site/deployments","created_at":"2012-11-10T23:42:07Z","updated_at":"2015-05-06T09:42:00Z","pushed_at":"2016-09-15T21:14:44Z","git_url":"git://github.com/asgrim/phph-site.git","ssh_url":"git@github.com:asgrim/phph-site.git","clone_url":"https://github.com/asgrim/phph-site.git","svn_url":"https://github.com/asgrim/phph-site","homepage":null,"size":1208,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"phphants:master","ref":"master","sha":"a5c7f01e8c036af0346c631ab0b7a1eaae73c9c9","user":{"login":"phphants","id":2431438,"avatar_url":"https://avatars.githubusercontent.com/u/2431438?v=3","gravatar_id":"","url":"https://api.github.com/users/phphants","html_url":"https://github.com/phphants","followers_url":"https://api.github.com/users/phphants/followers","following_url":"https://api.github.com/users/phphants/following{/other_user}","gists_url":"https://api.github.com/users/phphants/gists{/gist_id}","starred_url":"https://api.github.com/users/phphants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phphants/subscriptions","organizations_url":"https://api.github.com/users/phphants/orgs","repos_url":"https://api.github.com/users/phphants/repos","events_url":"https://api.github.com/users/phphants/events{/privacy}","received_events_url":"https://api.github.com/users/phphants/received_events","type":"Organization","site_admin":false},"repo":{"id":5979096,"name":"phph-site","full_name":"phphants/phph-site","owner":{"login":"phphants","id":2431438,"avatar_url":"https://avatars.githubusercontent.com/u/2431438?v=3","gravatar_id":"","url":"https://api.github.com/users/phphants","html_url":"https://github.com/phphants","followers_url":"https://api.github.com/users/phphants/followers","following_url":"https://api.github.com/users/phphants/following{/other_user}","gists_url":"https://api.github.com/users/phphants/gists{/gist_id}","starred_url":"https://api.github.com/users/phphants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phphants/subscriptions","organizations_url":"https://api.github.com/users/phphants/orgs","repos_url":"https://api.github.com/users/phphants/repos","events_url":"https://api.github.com/users/phphants/events{/privacy}","received_events_url":"https://api.github.com/users/phphants/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phphants/phph-site","description":"Website for www.phphants.co.uk","fork":false,"url":"https://api.github.com/repos/phphants/phph-site","forks_url":"https://api.github.com/repos/phphants/phph-site/forks","keys_url":"https://api.github.com/repos/phphants/phph-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phphants/phph-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phphants/phph-site/teams","hooks_url":"https://api.github.com/repos/phphants/phph-site/hooks","issue_events_url":"https://api.github.com/repos/phphants/phph-site/issues/events{/number}","events_url":"https://api.github.com/repos/phphants/phph-site/events","assignees_url":"https://api.github.com/repos/phphants/phph-site/assignees{/user}","branches_url":"https://api.github.com/repos/phphants/phph-site/branches{/branch}","tags_url":"https://api.github.com/repos/phphants/phph-site/tags","blobs_url":"https://api.github.com/repos/phphants/phph-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phphants/phph-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phphants/phph-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/phphants/phph-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phphants/phph-site/statuses/{sha}","languages_url":"https://api.github.com/repos/phphants/phph-site/languages","stargazers_url":"https://api.github.com/repos/phphants/phph-site/stargazers","contributors_url":"https://api.github.com/repos/phphants/phph-site/contributors","subscribers_url":"https://api.github.com/repos/phphants/phph-site/subscribers","subscription_url":"https://api.github.com/repos/phphants/phph-site/subscription","commits_url":"https://api.github.com/repos/phphants/phph-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/phphants/phph-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/phphants/phph-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/phphants/phph-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/phphants/phph-site/contents/{+path}","compare_url":"https://api.github.com/repos/phphants/phph-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phphants/phph-site/merges","archive_url":"https://api.github.com/repos/phphants/phph-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phphants/phph-site/downloads","issues_url":"https://api.github.com/repos/phphants/phph-site/issues{/number}","pulls_url":"https://api.github.com/repos/phphants/phph-site/pulls{/number}","milestones_url":"https://api.github.com/repos/phphants/phph-site/milestones{/number}","notifications_url":"https://api.github.com/repos/phphants/phph-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phphants/phph-site/labels{/name}","releases_url":"https://api.github.com/repos/phphants/phph-site/releases{/id}","deployments_url":"https://api.github.com/repos/phphants/phph-site/deployments","created_at":"2012-09-27T08:05:18Z","updated_at":"2016-08-15T13:20:52Z","pushed_at":"2016-09-15T21:14:44Z","git_url":"git://github.com/phphants/phph-site.git","ssh_url":"git@github.com:phphants/phph-site.git","clone_url":"https://github.com/phphants/phph-site.git","svn_url":"https://github.com/phphants/phph-site","homepage":null,"size":1263,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":19,"forks":5,"open_issues":19,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/112"},"html":{"href":"https://github.com/phphants/phph-site/pull/112"},"issue":{"href":"https://api.github.com/repos/phphants/phph-site/issues/112"},"comments":{"href":"https://api.github.com/repos/phphants/phph-site/issues/112/comments"},"review_comments":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/112/comments"},"review_comment":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/112/commits"},"statuses":{"href":"https://api.github.com/repos/phphants/phph-site/statuses/931cdcd4c9b98b127fc51169b74895ee349c2053"}}}}
{"actor":{"display_login":"asgrim"}}