1: <?php
2:
3: /*
4: * This file is part of the Gitter library.
5: *
6: * (c) Klaus Silveira <klaussilveira@php.net>
7: *
8: * For the full copyright and license information, please view the LICENSE
9: * file that was distributed with this source code.
10: */
11:
12: namespace Gitter\Model;
13:
14: class Line extends AbstractModel
15: {
16: protected $line;
17: protected $type;
18:
19: public function __construct($data)
20: {
21: if (!empty($data)) {
22: if ('@' == $data[0]) {
23: $this->setType('chunk');
24: }
25:
26: if ('-' == $data[0]) {
27: $this->setType('old');
28: }
29:
30: if ('+' == $data[0]) {
31: $this->setType('new');
32: }
33: }
34:
35: $this->setLine($data);
36: }
37:
38: public function getLine()
39: {
40: return $this->line;
41: }
42:
43: public function setLine($line)
44: {
45: $this->line = $line;
46:
47: return $this;
48: }
49:
50: public function getType()
51: {
52: return $this->type;
53: }
54:
55: public function setType($type)
56: {
57: $this->type = $type;
58:
59: return $this;
60: }
61: }
62: