l3pp4rd/DoctrineExtensions — pull request #779 by Koc (2013-07-15 22:37:29+00:00)
Title: [WIP] [Uploadable] Allow build path relative to default using "pathMethod" property

Quote from the documentation:

> For example, you can set specific paths for specific entities, or you can get the path from other sources (like a framework configuration) instead of hardcoding it in the entity.

But this is not possible get path from fw config yet. I've added basic support of this:

```php

$listener->setDefaultPath('/my/path');

/**
* @ORM\Entity
* @Gedmo\Uploadable(pathMethod="getPath")
*/
class Photo
{
public function getPath($defaultPath)
{
return $defaultPath.'/photos/'.mt_rand(10, 99).'/'.mt_rand(10, 99);
}
}
```

Let's discuss this before merging. How it could be better (put array with file information for adding possibility generate path depends on generated filename)?