{"action":"created","issue":{"url":"https://api.github.com/repos/Atlantic18/DoctrineExtensions/issues/1503","labels_url":"https://api.github.com/repos/Atlantic18/DoctrineExtensions/issues/1503/labels{/name}","comments_url":"https://api.github.com/repos/Atlantic18/DoctrineExtensions/issues/1503/comments","events_url":"https://api.github.com/repos/Atlantic18/DoctrineExtensions/issues/1503/events","html_url":"https://github.com/Atlantic18/DoctrineExtensions/issues/1503","id":126359824,"number":1503,"title":"ID of parent entity not available in filename generation of uploaded file","user":{"login":"SvetlinStaev","id":8427480,"avatar_url":"https://avatars.githubusercontent.com/u/8427480?v=3","gravatar_id":"","url":"https://api.github.com/users/SvetlinStaev","html_url":"https://github.com/SvetlinStaev","followers_url":"https://api.github.com/users/SvetlinStaev/followers","following_url":"https://api.github.com/users/SvetlinStaev/following{/other_user}","gists_url":"https://api.github.com/users/SvetlinStaev/gists{/gist_id}","starred_url":"https://api.github.com/users/SvetlinStaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SvetlinStaev/subscriptions","organizations_url":"https://api.github.com/users/SvetlinStaev/orgs","repos_url":"https://api.github.com/users/SvetlinStaev/repos","events_url":"https://api.github.com/users/SvetlinStaev/events{/privacy}","received_events_url":"https://api.github.com/users/SvetlinStaev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-13T07:31:43Z","updated_at":"2016-01-13T07:40:04Z","closed_at":null,"body":"Hi,\r\n\r\nI am having a problem with the uploadable extension. I have an Auction entity with an ArrayCollection of AuctionPicture entities which are configured as uploadable. When the auction form is submitted the files are uploaded correctly but I have a problem with the naming when using custom name generator.\r\n\r\nIn the generate method of the class as per:\r\n\r\n```\r\npublic static function generate($filename, $extension, $object = null);\r\n```\r\n\r\nI receive the AuctionPicture instance which is fine. It has a one-to-one relationship with the Auction and I receive it fine as ```$object->getAuction()``` but the problem is that I get the instance before the Auction is persisted so I do not get an ID for the Auction to use it in naming the file for the AuctionPicture. I would like to name it in the following format:\r\n\r\n```\r\n{AUCTION-ID}_{TIMESTAMP}.{EXTENSION}\r\n```\r\nIs there some configuration I am missing in having the entity being processed after the parent one is persisted?"},"comment":{"url":"https://api.github.com/repos/Atlantic18/DoctrineExtensions/issues/comments/171204389","html_url":"https://github.com/Atlantic18/DoctrineExtensions/issues/1503#issuecomment-171204389","issue_url":"https://api.github.com/repos/Atlantic18/DoctrineExtensions/issues/1503","id":171204389,"user":{"login":"l3pp4rd","id":132389,"avatar_url":"https://avatars.githubusercontent.com/u/132389?v=3","gravatar_id":"","url":"https://api.github.com/users/l3pp4rd","html_url":"https://github.com/l3pp4rd","followers_url":"https://api.github.com/users/l3pp4rd/followers","following_url":"https://api.github.com/users/l3pp4rd/following{/other_user}","gists_url":"https://api.github.com/users/l3pp4rd/gists{/gist_id}","starred_url":"https://api.github.com/users/l3pp4rd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l3pp4rd/subscriptions","organizations_url":"https://api.github.com/users/l3pp4rd/orgs","repos_url":"https://api.github.com/users/l3pp4rd/repos","events_url":"https://api.github.com/users/l3pp4rd/events{/privacy}","received_events_url":"https://api.github.com/users/l3pp4rd/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T07:40:04Z","updated_at":"2016-01-13T07:40:04Z","body":"hi, it cannot have ID in this stage, either change the name to some hash of file or use custom implementation of uploading. In general uploadable extension is rarely used, because there may be many custom features which may need manual intervention."}}