00001 <?php 00003 // {{{ license 00004 00005 // +----------------------------------------------------------------------+ 00006 // | FastFrame Application Framework | 00007 // +----------------------------------------------------------------------+ 00008 // | Copyright (c) 2002-2006 The Codejanitor Group | 00009 // +----------------------------------------------------------------------+ 00010 // | This source file is subject to the GNU Lesser Public License (LGPL), | 00011 // | that is bundled with this package in the file LICENSE, and is | 00012 // | available at through the world-wide-web at | 00013 // | http://www.fsf.org/copyleft/lesser.html | 00014 // | If you did not receive a copy of the LGPL and are unable to | 00015 // | obtain it through the world-wide-web, you can get it by writing the | 00016 // | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, | 00017 // | MA 02111-1307, USA. | 00018 // +----------------------------------------------------------------------+ 00019 // | Authors: Jason Rust <jrust@codejanitor.com> | 00020 // +----------------------------------------------------------------------+ 00021 00022 // }}} 00023 // {{{ requires 00024 00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/Model.php'; 00026 00027 // }}} 00028 // {{{ class FF_Model_TicketComment 00029 00042 // }}} 00043 class FF_Model_TicketComment extends FF_Model { 00044 // {{{ properties 00045 00050 var $ticketId; 00051 00056 var $creatorId; 00057 00062 var $createDate; 00063 00068 var $isPrivate = false; 00069 00074 var $comment; 00075 00076 // }}} 00077 // {{{ reset() 00078 00085 function reset() 00086 { 00087 $this->id = null; 00088 $this->ticketId = null; 00089 $this->creatorId = null; 00090 $this->createDate = null; 00091 $this->isPrivate = false; 00092 $this->comment = null; 00093 } 00094 00095 // }}} 00096 // {{{ importFromArray() 00097 00106 function importFromArray($in_data) 00107 { 00108 $this->setId($in_data['id']); 00109 $this->setTicketId($in_data['ticket_id']); 00110 $this->setCreatorId($in_data['creator_id']); 00111 $this->setCreateDate($in_data['create_date']); 00112 $this->setIsPrivate($in_data['is_private']); 00113 $this->setComment($in_data['comment']); 00114 } 00115 00116 // }}} 00117 // {{{ exportToArray() 00118 00127 function exportToArray() 00128 { 00129 $a_data = array(); 00130 $a_data['id'] = $this->getId(); 00131 $a_data['ticket_id'] = $this->getTicketId(); 00132 $a_data['creator_id'] = $this->getCreatorId(); 00133 $a_data['create_date'] = $this->getCreateDate(); 00134 $a_data['is_private'] = $this->getIsPrivate(); 00135 $a_data['comment'] = $this->getComment(); 00136 return $a_data; 00137 } 00138 00139 // }}} 00140 // {{{ getCommentsByTicketId() 00141 00151 function getCommentsByTicketId($in_id, $in_mostRecent) 00152 { 00153 return $this->o_dataAccess->getCommentsByTicketId($in_id, $in_mostRecent); 00154 } 00155 00156 // }}} 00157 // {{{ getTicketId() 00158 00159 function getTicketId() 00160 { 00161 return $this->ticketId; 00162 } 00163 00164 // }}} 00165 // {{{ setTicketId() 00166 00167 function setTicketId($in_value) 00168 { 00169 $this->ticketId = $in_value; 00170 } 00171 00172 // }}} 00173 // {{{ getUserFullName() 00174 00181 function getUserFullName() 00182 { 00183 $o_dao =& FF_DataAccess::factory('Profile', 'profile'); 00184 return $o_dao->getFullNameById($this->getCreatorId()); 00185 } 00186 00187 // }}} 00188 // {{{ getCreatorId() 00189 00190 function getCreatorId() 00191 { 00192 return $this->creatorId; 00193 } 00194 00195 // }}} 00196 // {{{ setCreatorId() 00197 00198 function setCreatorId($in_value) 00199 { 00200 $this->creatorId = $in_value; 00201 } 00202 00203 // }}} 00204 // {{{ getFormattedCreateDate() 00205 00212 function getFormattedCreateDate() 00213 { 00214 return FF_Util::formatRelativeDate($this->getCreateDate()); 00215 } 00216 00217 // }}} 00218 // {{{ getCreateDate() 00219 00220 function getCreateDate() 00221 { 00222 return $this->createDate; 00223 } 00224 00225 // }}} 00226 // {{{ setCreateDate() 00227 00228 function setCreateDate($in_value) 00229 { 00230 $this->createDate = $in_value; 00231 } 00232 00233 // }}} 00234 // {{{ getIsPrivate() 00235 00236 function getIsPrivate() 00237 { 00238 return $this->isPrivate; 00239 } 00240 00241 // }}} 00242 // {{{ setIsPrivate() 00243 00244 function setIsPrivate($in_value) 00245 { 00246 $this->isPrivate = $this->_scalarToBool($in_value); 00247 } 00248 00249 // }}} 00250 // {{{ getComment() 00251 00252 function getComment() 00253 { 00254 return $this->comment; 00255 } 00256 00257 // }}} 00258 // {{{ setComment() 00259 00260 function setComment($in_value) 00261 { 00262 $this->comment = $in_value; 00263 } 00264 00265 // }}} 00266 // {{{ _initDataAccess() 00267 00274 function _initDataAccess() 00275 { 00276 $this->o_dataAccess =& FF_DataAccess::factory('TicketComment'); 00277 } 00278 00279 // }}} 00280 } 00281 ?>
1.4.4