| 1 | <?php |
||
| 29 | class OrderNumberCounter implements EntityInterface, IdentifiableEntityInterface, ImmutableEntityInterface |
||
| 30 | { |
||
| 31 | use EntityTrait, IdentifiableEntityTrait, ImmutableEntityTrait; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * The name of this counter. used as Prefix for the number. |
||
| 35 | * |
||
| 36 | * @ODM\String |
||
| 37 | * @var string |
||
| 38 | */ |
||
| 39 | protected $name; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * the next counter number to use. |
||
| 43 | * |
||
| 44 | * @ODM\Field(type="int") |
||
| 45 | * @var int |
||
| 46 | */ |
||
| 47 | protected $count = 0; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param string $name |
||
| 51 | * |
||
| 52 | * @return self |
||
| 53 | */ |
||
| 54 | public function setName($name) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | public function getName() |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param int $count |
||
| 71 | * |
||
| 72 | * @return self |
||
| 73 | */ |
||
| 74 | public function setCount($count) |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @return int |
||
| 83 | */ |
||
| 84 | public function getCount() |
||
| 88 | |||
| 89 | public function format($format = null) |
||
| 97 | |||
| 98 | public function __toString() |
||
| 102 | } |