-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdomain-model.php
More file actions
34 lines (19 loc) · 788 Bytes
/
domain-model.php
File metadata and controls
34 lines (19 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* Domain Model example
*/
include_once __DIR__ . '/vendor/autoload.php';
$product = new \DL\Model\Product(1, new \DL\Strategy\ThreeWayRecognitionStrategy(30, 100));
$contract = new \DL\Model\Contract($product, date('Y-m-d H:i:s', time()));
echo '<strong>Original Contract</strong>';
var_dump($contract);
echo '<strong>Contract (Three way Recognition)</strong>';
$contract->calculateRecognitions();
var_dump($contract);
$product = new \DL\Model\Product(2, new \DL\Strategy\CompleteRecognitionStrategy());
$contract = new \DL\Model\Contract($product, date('Y-m-d H:i:s', time()));
echo '<hr><strong>Original Contract</strong>';
var_dump($contract);
echo '<strong>Contract (Complete Recognition)</strong>';
$contract->calculateRecognitions();
var_dump($contract);