Work on making country nullable. Presently the datamapper cant deal with it though...
[rock.divinelegy.git] / Domain / Entities / UserStepByStepBuilder.php
1 <?php
2
3 namespace Domain\Entities;
4
5 use Domain\VOs\ICountry;
6 use Domain\VOs\IName;
7
8 interface IUserStepByStepBuilder
9 {
10 public function With_DisplayName($name);
11 }
12
13 interface IUserStepByStepBuilder_With_DisplayName
14 {
15 public function With_Name(IName $name);
16 }
17
18 interface IUserStepByStepBuilder_With_Name
19 {
20 public function With_Tags(array $tags);
21 }
22
23 interface IUserStepByStepBuilder_With_Tags
24 {
25 public function With_FacebookId($id);
26 }
27
28 interface IUserStepByStepBuilder_With_FacebookId
29 {
30 public function With_Quota($quota);
31 }
32
33 interface IUserStepByStepBuilder_With_Quota
34 {
35 public function With_YearsStepArtist($years); //not going to make this mandatory as it is kind of a joke
36 public function With_Country(ICountry $country = null);
37 public function build();
38 }
39
40 abstract class AbstractUserStepByStepBuilder
41 {
42 protected $_userBuilder;
43
44 public function __construct(IUserBuilder $builder)
45 {
46 $this->_userBuilder = $builder;
47 }
48 }
49
50 class UserStepByStepBuilder extends AbstractUserStepByStepBuilder implements IUserStepByStepBuilder
51 {
52 public function With_DisplayName($name) {
53 $this->_userBuilder->With_DisplayName($name);
54 return new UserStepByStepBuilder_With_DisplayName($this->_userBuilder);
55 }
56 }
57
58 class UserStepByStepBuilder_With_DisplayName extends AbstractUserStepByStepBuilder implements IUserStepByStepBuilder_With_DisplayName
59 {
60 public function With_Name(IName $name) {
61 $this->_userBuilder->With_Name($name);
62 return new UserStepByStepBuilder_With_Name($this->_userBuilder);
63 }
64 }
65
66 class UserStepByStepBuilder_With_Name extends AbstractUserStepByStepBuilder implements IUserStepByStepBuilder_With_Name
67 {
68 public function With_Tags(array $tags) {
69 $this->_userBuilder->With_Tags($tags);
70 return new UserStepByStepBuilder_With_Tags($this->_userBuilder);
71 }
72 }
73
74 class UserStepByStepBuilder_With_Tags extends AbstractUserStepByStepBuilder implements IUserStepByStepBuilder_With_Tags
75 {
76 public function With_FacebookId($id) {
77 $this->_userBuilder->With_FacebookId($id);
78 return new UserStepByStepBuilder_With_FacebookId($this->_userBuilder);
79 }
80 }
81
82 class UserStepByStepBuilder_With_FacebookId extends AbstractUserStepByStepBuilder implements IUserStepByStepBuilder_With_FacebookId
83 {
84 public function With_Quota($quota)
85 {
86 $this->_userBuilder->With_Quota($quota);
87 return new UserStepByStepBuilder_With_Quota($this->_userBuilder);
88 }
89 }
90
91 class UserStepByStepBuilder_With_Quota extends AbstractUserStepByStepBuilder implements IUserStepByStepBuilder_With_Quota
92 {
93 public function With_YearsStepArtist($years) {
94 $this->_userBuilder->With_YearsStepArtist($years);
95 return $this;
96 }
97
98 public function With_Country(ICountry $country = null) {
99 $this->_userBuilder->With_Country($country);
100 return $this;
101 }
102
103 public function build() {
104 return $this->_userBuilder
105 ->build();
106 }
107 }