1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace ICanBoogie\Mailer;
13
14 use ICanBoogie\PropertyNotDefined;
15
16 17 18 19 20
21 class MessagePart
22 {
23 protected ;
24 public $body;
25
26 public function __construct($body, array $header_fields=[])
27 {
28 $this->header = new Header($header_fields);
29 $this->body = $body;
30 }
31
32 public function __clone()
33 {
34 $this->header = clone $this->header;
35 }
36
37 public function __get($property)
38 {
39 switch ($property)
40 {
41 case 'header':
42
43 return $this->header;
44 }
45
46 throw new PropertyNotDefined([ $property, $this ]);
47 }
48
49 public function __set($property, $value)
50 {
51 throw new PropertyNotDefined([ $property, $this ]);
52 }
53 }