{"action":"created","issue":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/4737","repository_url":"https://api.github.com/repos/Sylius/Sylius","labels_url":"https://api.github.com/repos/Sylius/Sylius/issues/4737/labels{/name}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/4737/comments","events_url":"https://api.github.com/repos/Sylius/Sylius/issues/4737/events","html_url":"https://github.com/Sylius/Sylius/issues/4737","id":147285657,"number":4737,"title":"[Metadata] Discussion","user":{"login":"inssein","id":882228,"avatar_url":"https://avatars.githubusercontent.com/u/882228?v=3","gravatar_id":"","url":"https://api.github.com/users/inssein","html_url":"https://github.com/inssein","followers_url":"https://api.github.com/users/inssein/followers","following_url":"https://api.github.com/users/inssein/following{/other_user}","gists_url":"https://api.github.com/users/inssein/gists{/gist_id}","starred_url":"https://api.github.com/users/inssein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inssein/subscriptions","organizations_url":"https://api.github.com/users/inssein/orgs","repos_url":"https://api.github.com/users/inssein/repos","events_url":"https://api.github.com/users/inssein/events{/privacy}","received_events_url":"https://api.github.com/users/inssein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-11T00:56:35Z","updated_at":"2016-04-11T13:27:42Z","closed_at":null,"body":"I have been looking at the Metadata bundle and component today, there are a few things I wanted to talk about.\r\n\r\nFirstly, I think we should switch from just Twitter Card to [Open Graph](http://ogp.me/) fields, and then supplement that with platform specific fields (facebook app id, twitter card type, twitter site, etc). This is what I am currently doing for static pages, and it makes sense. What do you guys think?\r\n\r\nSecondly, there are a few big things still left in Metadata, such as support for Translations (https://github.com/Sylius/Sylius/issues/4481) and https://github.com/Sylius/Sylius/issues/4482.\r\n\r\nSo far all the issues about Metadata have not received any feedback, but I understand that you guys are busy. I don't mind doing work in this area, it would just be nice to clarify the issues with you guys, and hear any other feedback you may have.\r\n\r\n@peteward @pjedrzejewski @pamil "},"comment":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/comments/208341079","html_url":"https://github.com/Sylius/Sylius/issues/4737#issuecomment-208341079","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/4737","id":208341079,"user":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T13:27:42Z","updated_at":"2016-04-11T13:27:42Z","body":"The main issue on the implementation side now is the integration with Doctrine. As I've mentioned in #4670:\r\n\r\n> Metadata cannot be stored as object ORM type, because objects are\r\ncompared (===) by reference, not by value, what means that changes\r\nwould not be persisted.\r\n\r\n> The only working way I have found is to store metadata as text\r\ntype and serialize it on MetadataContainer::setMetadata() method\r\ncall. However, after every metadata modification we have to use that\r\nmethod once again, if not - changes won't be persisted.\r\n\r\nThe current implementation is quite unfortunate:\r\n\r\n```php\r\n$metadataContainer = new MetadataContainer();\r\n$pageMetadata = new PageMetadata();\r\n\r\n$pageMetadata->setFoo('Before setMetadata');\r\n\r\n$metadataContainer->setMetadata($pageMetadata); // Serializes page metadata at that moment\r\n\r\n$pageMetadata->setFoo('After setMetadata');\r\n\r\n$metadataContainer->getMetadata()->getFoo(); // Returns 'After setMetadata', looks good\r\n\r\n// But under the hood...\r\n// $metadataContainer has serialized metadata with foo set to 'Before setMetadata'\r\n// So if we get that from the database\r\n\r\n$metadataContainer = $metadataContainerRepository->find(42);\r\n$metadataContainer->getMetadata()->getFoo(); // Returns 'Before setMetadata', shit happens\r\n```"}}