Misc bugfixes.
[rock.divinelegy.git] / Domain / Entities / StepMania / PackBuilder.php
1 <?php
2
3 namespace Domain\Entities\StepMania;
4
5 use Domain\Entities\IUser;
6 use Domain\Entities\IFile;
7 use Domain\Entities\StepMania\IPackFactory;
8 use Domain\Entities\StepMania\IPackBuilder;
9
10 class PackBuilder implements IPackBuilder
11 {
12
13 private $_packFactory;
14 private $_title;
15 private $_uploader;
16 private $_simfiles;
17 private $_banner;
18 private $_file;
19
20 //override parent
21 public function __construct(IPackFactory $packFactory)
22 {
23 $this->_packFactory = $packFactory;
24 }
25
26 public function With_Title($title)
27 {
28 $this->_title = $title;
29 return $this;
30 }
31
32 public function With_Banner(IFile $banner = null)
33 {
34 $this->_banner = $banner;
35 }
36
37 public function With_File(IFile $file)
38 {
39 $this->_file = $file;
40 return $this;
41 }
42
43 public function With_Simfiles(array $simfiles)
44 {
45 $this->_simfiles = $simfiles;
46 return $this;
47 }
48
49 public function With_Uploader(IUser $uploader)
50 {
51 $this->_uploader = $uploader;
52 return $this;
53 }
54
55 public function build()
56 {
57 return $this->_packFactory->createInstance($this->_title,
58 $this->_uploader,
59 $this->_simfiles,
60 $this->_banner,
61 $this->_file);
62 }
63 }