File tree Expand file tree Collapse file tree 7 files changed +294
-0
lines changed
Expand file tree Collapse file tree 7 files changed +294
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,22 @@ ArticleDetail(
8181 int <articleTypeId>
8282)
8383```
84+ ##### ArticleIndividualization
85+ Represtens the article individualization configuration
86+ ```
87+ ArticleIndividualization(
88+ bool <hasFallback>
89+ array <individualizationItems>
90+ )
91+ ```
92+ ##### ArticleIndividualizationItem
93+
94+ ```
95+ ArticleIndividualizationItem(
96+ int <targetgroupId>
97+ int <articleId>
98+ )
99+ ```
84100### Blacklist
85101##### BlackList
86102Represents a list of BlackListItems for one specific mandator.<br >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Scn \EvalancheSoapStruct \Struct \Article ;
6+
7+ /**
8+ * Represtens the article individualization configuration
9+ */
10+ class ArticleIndividualization implements ArticleIndividualizationInterface
11+ {
12+ /**
13+ * @var bool
14+ */
15+ private $ hasFallback ;
16+
17+ /**
18+ * @var array<ArticleIndividualizationItemInterface>
19+ */
20+ private $ individualizationItems ;
21+
22+ public function __construct (
23+ bool $ hasFallback = false ,
24+ array $ individualizationItems = []
25+ ) {
26+ $ this ->hasFallback = $ hasFallback ;
27+ $ this ->individualizationItems = $ individualizationItems ;
28+ }
29+
30+ /**
31+ * Is `true` if a fallback configuration is set
32+ */
33+ public function isHasFallback (): bool
34+ {
35+ return $ this ->hasFallback ;
36+ }
37+
38+ /**
39+ * Set the fallback configuration
40+ */
41+ public function setHasFallback (bool $ hasFallback ): void
42+ {
43+ $ this ->hasFallback = $ hasFallback ;
44+ }
45+
46+ /**
47+ * @return array<ArticleIndividualizationItemInterface>
48+ */
49+ public function getIndividualizationItems (): array
50+ {
51+ return $ this ->individualizationItems ;
52+ }
53+
54+ /**
55+ * @param array<ArticleIndividualizationItemInterface> $individualizationItems
56+ */
57+ public function setIndividualizationItems (array $ individualizationItems ): void
58+ {
59+ $ this ->individualizationItems = $ individualizationItems ;
60+ }
61+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Scn \EvalancheSoapStruct \Struct \Article ;
4+
5+ use Scn \EvalancheSoapStruct \Struct \StructInterface ;
6+
7+ interface ArticleIndividualizationInterface extends StructInterface
8+ {
9+ /**
10+ * Is `true` if a fallback configuration is set
11+ */
12+ public function isHasFallback (): bool ;
13+
14+ /**
15+ * Set the fallback configuration
16+ */
17+ public function setHasFallback (bool $ hasFallback ): void ;
18+
19+ /**
20+ * @return array<ArticleIndividualizationItemInterface>
21+ */
22+ public function getIndividualizationItems (): array ;
23+
24+ /**
25+ * @param array<ArticleIndividualizationItemInterface> $individualizationItems
26+ */
27+ public function setIndividualizationItems (array $ individualizationItems ): void ;
28+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Scn \EvalancheSoapStruct \Struct \Article ;
6+
7+ /**
8+ * Represents a article-id/targetgroup tuple in the article individualization config
9+ */
10+ class ArticleIndividualizationItem implements ArticleIndividualizationItemInterface
11+ {
12+ /**
13+ * @var int
14+ */
15+ private $ targetgroupId ;
16+
17+ /**
18+ * @var int
19+ */
20+ private $ articleId ;
21+
22+ public function __construct (
23+ int $ targetgroupId = 0 ,
24+ int $ articleId = 0
25+ ) {
26+ $ this ->targetgroupId = $ targetgroupId ;
27+ $ this ->articleId = $ articleId ;
28+ }
29+
30+ /**
31+ * @return int
32+ */
33+ public function getTargetgroupId (): int
34+ {
35+ return $ this ->targetgroupId ;
36+ }
37+
38+ /**
39+ * @param int $targetgroupId
40+ */
41+ public function setTargetgroupId (int $ targetgroupId ): void
42+ {
43+ $ this ->targetgroupId = $ targetgroupId ;
44+ }
45+
46+ /**
47+ * @return int
48+ */
49+ public function getArticleId (): int
50+ {
51+ return $ this ->articleId ;
52+ }
53+
54+ /**
55+ * @param int $articleId
56+ */
57+ public function setArticleId (int $ articleId ): void
58+ {
59+ $ this ->articleId = $ articleId ;
60+ }
61+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Scn \EvalancheSoapStruct \Struct \Article ;
4+
5+ use Scn \EvalancheSoapStruct \Struct \StructInterface ;
6+
7+ interface ArticleIndividualizationItemInterface extends StructInterface
8+ {
9+ /**
10+ * @return int
11+ */
12+ public function getTargetgroupId (): int ;
13+
14+ /**
15+ * @param int $targetgroupId
16+ */
17+ public function setTargetgroupId (int $ targetgroupId ): void ;
18+
19+ /**
20+ * @return int
21+ */
22+ public function getArticleId (): int ;
23+
24+ /**
25+ * @param int $articleId
26+ */
27+ public function setArticleId (int $ articleId ): void ;
28+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Scn \EvalancheSoapStruct \Struct \Article ;
6+
7+ use Scn \EvalancheSoapStruct \StructTestCase ;
8+
9+ class ArticleIndividualizationItemTest extends StructTestCase
10+ {
11+ /** @var ArticleIndividualizationItem */
12+ private $ subject ;
13+
14+ protected function setUp (): void
15+ {
16+ $ this ->subject = new ArticleIndividualizationItem ();
17+ }
18+
19+ public function testTargetgroupIdSetGet (): void
20+ {
21+ $ value = 666 ;
22+
23+ static ::assertSame (
24+ 0 ,
25+ $ this ->subject ->getTargetgroupId ()
26+ );
27+
28+ $ this ->subject ->setTargetgroupId ($ value );
29+
30+ static ::assertSame (
31+ $ value ,
32+ $ this ->subject ->getTargetgroupId ()
33+ );
34+ }
35+
36+ public function testArticleIdSetGet (): void
37+ {
38+ $ value = 666 ;
39+
40+ static ::assertSame (
41+ 0 ,
42+ $ this ->subject ->getArticleId ()
43+ );
44+
45+ $ this ->subject ->setArticleId ($ value );
46+
47+ static ::assertSame (
48+ $ value ,
49+ $ this ->subject ->getArticleId ()
50+ );
51+ }
52+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Scn \EvalancheSoapStruct \Struct \Article ;
6+
7+ use Scn \EvalancheSoapStruct \StructTestCase ;
8+
9+ class ArticleIndividualizationTest extends StructTestCase
10+ {
11+ /** @var ArticleIndividualization */
12+ private $ subject ;
13+
14+ protected function setUp (): void
15+ {
16+ $ this ->subject = new ArticleIndividualization ();
17+ }
18+
19+ public function testHasFallbachSetGet (): void
20+ {
21+ static ::assertFalse (
22+ $ this ->subject ->isHasFallback ()
23+ );
24+
25+ $ this ->subject ->setHasFallback (true );
26+
27+ static ::assertTrue (
28+ $ this ->subject ->isHasFallback ()
29+ );
30+ }
31+
32+ public function testGetIndividualizationItemsSetGet (): void
33+ {
34+ $ items = ['some-item ' ];
35+
36+ static ::assertSame (
37+ [],
38+ $ this ->subject ->getIndividualizationItems ()
39+ );
40+
41+ $ this ->subject ->setIndividualizationItems ($ items );
42+
43+ static ::assertSame (
44+ $ items ,
45+ $ this ->subject ->getIndividualizationItems ()
46+ );
47+ }
48+ }
You can’t perform that action at this time.
0 commit comments