@@ 51-61 (lines=11) @@ | ||
48 | } |
|
49 | } |
|
50 | ||
51 | public function add($interval) : self |
|
52 | { |
|
53 | $d1 = $this->getRefDT(); |
|
54 | $d1->add($this); |
|
55 | $d1->add(new self($interval)); |
|
56 | $int = ($this->getRefDT())->diff($d1); |
|
57 | $this->__construct(self::parse($int)); |
|
58 | if ($d1 < $this->getRefDT()) |
|
59 | $this->invert = 1; |
|
60 | return $this; |
|
61 | } |
|
62 | ||
63 | public function sub($interval) : self |
|
64 | { |
|
@@ 63-73 (lines=11) @@ | ||
60 | return $this; |
|
61 | } |
|
62 | ||
63 | public function sub($interval) : self |
|
64 | { |
|
65 | $d1 = $this->getRefDT(); |
|
66 | $d1->add($this); |
|
67 | $d1->sub(new self($interval)); |
|
68 | $int = ($this->getRefDT())->diff($d1); |
|
69 | $this->__construct(self::parse($int)); |
|
70 | if ($d1 < $this->getRefDT()) |
|
71 | $this->invert = 1; |
|
72 | return $this; |
|
73 | } |
|
74 | ||
75 | public function toSeconds() : int |
|
76 | { |