3 namespace Domain\Entities
;
5 use Domain\VOs\ICountry
;
8 interface IUserStepByStepBuilder
10 public function With_DisplayName($name);
13 interface IUserStepByStepBuilder_With_DisplayName
15 public function With_Name(IName
$name);
18 interface IUserStepByStepBuilder_With_Name
20 public function With_Tags(array $tags);
23 interface IUserStepByStepBuilder_With_Tags
25 public function With_FacebookId($id);
28 interface IUserStepByStepBuilder_With_FacebookId
30 public function With_Quota($quota);
33 interface IUserStepByStepBuilder_With_Quota
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();
40 abstract class AbstractUserStepByStepBuilder
42 protected $_userBuilder;
44 public function __construct(IUserBuilder
$builder)
46 $this->_userBuilder
= $builder;
50 class UserStepByStepBuilder
extends AbstractUserStepByStepBuilder
implements IUserStepByStepBuilder
52 public function With_DisplayName($name) {
53 $this->_userBuilder
->With_DisplayName($name);
54 return new UserStepByStepBuilder_With_DisplayName($this->_userBuilder
);
58 class UserStepByStepBuilder_With_DisplayName
extends AbstractUserStepByStepBuilder
implements IUserStepByStepBuilder_With_DisplayName
60 public function With_Name(IName
$name) {
61 $this->_userBuilder
->With_Name($name);
62 return new UserStepByStepBuilder_With_Name($this->_userBuilder
);
66 class UserStepByStepBuilder_With_Name
extends AbstractUserStepByStepBuilder
implements IUserStepByStepBuilder_With_Name
68 public function With_Tags(array $tags) {
69 $this->_userBuilder
->With_Tags($tags);
70 return new UserStepByStepBuilder_With_Tags($this->_userBuilder
);
74 class UserStepByStepBuilder_With_Tags
extends AbstractUserStepByStepBuilder
implements IUserStepByStepBuilder_With_Tags
76 public function With_FacebookId($id) {
77 $this->_userBuilder
->With_FacebookId($id);
78 return new UserStepByStepBuilder_With_FacebookId($this->_userBuilder
);
82 class UserStepByStepBuilder_With_FacebookId
extends AbstractUserStepByStepBuilder
implements IUserStepByStepBuilder_With_FacebookId
84 public function With_Quota($quota)
86 $this->_userBuilder
->With_Quota($quota);
87 return new UserStepByStepBuilder_With_Quota($this->_userBuilder
);
91 class UserStepByStepBuilder_With_Quota
extends AbstractUserStepByStepBuilder
implements IUserStepByStepBuilder_With_Quota
93 public function With_YearsStepArtist($years) {
94 $this->_userBuilder
->With_YearsStepArtist($years);
98 public function With_Country(ICountry
$country = null
) {
99 $this->_userBuilder
->With_Country($country);
103 public function build() {
104 return $this->_userBuilder