| @@ 59-72 (lines=14) @@ | ||
| 56 | $this->serviceLocator = $locator; |
|
| 57 | } |
|
| 58 | ||
| 59 | public function getGameUserPath($game, $user) |
|
| 60 | { |
|
| 61 | $path = $this->getOptions()->getMediaPath() . DIRECTORY_SEPARATOR; |
|
| 62 | $path .= 'game' . $game->getId() . DIRECTORY_SEPARATOR; |
|
| 63 | if (!is_dir($path)) { |
|
| 64 | mkdir($path, 0777, true); |
|
| 65 | } |
|
| 66 | $path .= 'user'. $user->getId() . DIRECTORY_SEPARATOR; |
|
| 67 | if (!is_dir($path)) { |
|
| 68 | mkdir($path, 0777, true); |
|
| 69 | } |
|
| 70 | ||
| 71 | return $path; |
|
| 72 | } |
|
| 73 | ||
| 74 | public function getGameUserMediaUrl($game, $user) |
|
| 75 | { |
|
| @@ 21-34 (lines=14) @@ | ||
| 18 | return new \PlaygroundGame\Entity\PostVote; |
|
| 19 | } |
|
| 20 | ||
| 21 | public function getPath($post) |
|
| 22 | { |
|
| 23 | $path = $this->getOptions()->getMediaPath() . DIRECTORY_SEPARATOR; |
|
| 24 | $path .= 'game' . $post->getPostVote()->getId() . DIRECTORY_SEPARATOR; |
|
| 25 | if (!is_dir($path)) { |
|
| 26 | mkdir($path, 0777, true); |
|
| 27 | } |
|
| 28 | $path .= 'post'. $post->getId() . DIRECTORY_SEPARATOR; |
|
| 29 | if (!is_dir($path)) { |
|
| 30 | mkdir($path, 0777, true); |
|
| 31 | } |
|
| 32 | ||
| 33 | return $path; |
|
| 34 | } |
|
| 35 | ||
| 36 | public function getMediaUrl($post) |
|
| 37 | { |
|
| @@ 14-27 (lines=14) @@ | ||
| 11 | protected $tradingcardmodelMapper; |
|
| 12 | protected $tradingcardcardMapper; |
|
| 13 | ||
| 14 | public function getModelPath($model) |
|
| 15 | { |
|
| 16 | $path = $this->getOptions()->getMediaPath() . DIRECTORY_SEPARATOR; |
|
| 17 | $path .= 'game' . $model->getGame()->getId() . DIRECTORY_SEPARATOR; |
|
| 18 | if (!is_dir($path)) { |
|
| 19 | mkdir($path, 0777, true); |
|
| 20 | } |
|
| 21 | $path .= 'model'. $model->getId() . DIRECTORY_SEPARATOR; |
|
| 22 | if (!is_dir($path)) { |
|
| 23 | mkdir($path, 0777, true); |
|
| 24 | } |
|
| 25 | ||
| 26 | return $path; |
|
| 27 | } |
|
| 28 | ||
| 29 | public function getModelMediaUrl($model) |
|
| 30 | { |
|