1: <?php
2: /**
3: * Base quick log class.
4: *
5: * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
6: *
7: * See the enclosed file COPYING for license information (LGPL). If you
8: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
9: *
10: * @package Vcs
11: */
12: abstract class Horde_Vcs_QuickLog_Base
13: {
14: /**
15: * A repository object.
16: *
17: * @var Horde_Vcs_Base
18: */
19: protected $_rep;
20:
21: /**
22: * A log revision.
23: *
24: * @var string
25: */
26: protected $_rev;
27:
28: /**
29: * A log author.
30: *
31: * @var string
32: */
33: protected $_author;
34:
35: /**
36: * A log timestamp.
37: *
38: * @var integer
39: */
40: protected $_date;
41:
42: /**
43: * A log message.
44: *
45: * @var string
46: */
47: protected $_log;
48:
49: /**
50: * Constructor.
51: *
52: * @param Horde_Vcs_Base $rep A repository object.
53: * @param string $rev A log revision.
54: * @param integer $date A log timestamp.
55: * @param string $author A log author.
56: * @param string $log A log message.
57: */
58: public function __construct($rep, $rev, $date = null, $author = null,
59: $log = null)
60: {
61: $this->_rep = $rep;
62: $this->_rev = $rev;
63: $this->_date = $date;
64: $this->_author = $author;
65: $this->_log = $log;
66: }
67:
68: /**
69: * When serializing, don't return the repository object
70: */
71: public function __sleep()
72: {
73: return array_diff(array_keys(get_object_vars($this)), array('_rep'));
74: }
75:
76: /**
77: * Returns the log revision.
78: *
79: * @return string A revision.
80: */
81: public function getRevision()
82: {
83: return $this->_rev;
84: }
85:
86: /**
87: * Returns the log date.
88: *
89: * @return integer A date.
90: */
91: public function getDate()
92: {
93: return $this->_date;
94: }
95:
96: /**
97: * Returns the log author.
98: *
99: * @return string An author.
100: */
101: public function getAuthor()
102: {
103: return $this->_author;
104: }
105:
106: /**
107: * Returns the log message.
108: *
109: * @return string A message.
110: */
111: public function getMessage()
112: {
113: return $this->_log;
114: }
115: }
116: