00001 <?php
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/Model.php';
00026
00027
00028
00029
00039
00040 class FF_Model_Resolution extends FF_Model {
00041
00042
00047 var $name;
00048
00053 var $isDefault = false;
00054
00059 var $defaultResponse;
00060
00061
00062
00063
00070 function reset()
00071 {
00072 $this->id = null;
00073 $this->name = null;
00074 $this->isDefault = false;
00075 $this->defaultResponse = null;
00076 }
00077
00078
00079
00080
00089 function importFromArray($in_data)
00090 {
00091 $this->setId($in_data['id']);
00092 $this->setName($in_data['name']);
00093 $this->setIsDefault($in_data['is_default']);
00094 $this->setDefaultResponse($in_data['default_response']);
00095 }
00096
00097
00098
00099
00108 function exportToArray()
00109 {
00110 $a_data = array();
00111 $a_data['id'] = $this->getId();
00112 $a_data['name'] = $this->getName();
00113 $a_data['is_default'] = $this->getIsDefault();
00114 $a_data['default_response'] = $this->getDefaultResponse();
00115 return $a_data;
00116 }
00117
00118
00119
00120
00121 function getName()
00122 {
00123 return $this->name;
00124 }
00125
00126
00127
00128
00129 function setName($in_value)
00130 {
00131 $this->name = $in_value;
00132 }
00133
00134
00135
00136
00137 function getIsDefault($in_formatted = false)
00138 {
00139 return $in_formatted ? $this->isDefault ? _('Yes') : _('No') : $this->isDefault;
00140 }
00141
00142
00143
00144
00145 function setIsDefault($in_value)
00146 {
00147 $this->isDefault = $this->_scalarToBool($in_value);
00148 }
00149
00150
00151
00152
00159 function getLimitedDefaultResponse()
00160 {
00161 if (strlen($this->defaultResponse) > 100) {
00162 return substr($this->defaultResponse, 0, 100) . '...';
00163 }
00164 else {
00165 return $this->defaultResponse;
00166 }
00167 }
00168
00169
00170
00171
00172 function getDefaultResponse()
00173 {
00174 return $this->defaultResponse;
00175 }
00176
00177
00178
00179
00180 function setDefaultResponse($in_value)
00181 {
00182 $this->defaultResponse = $in_value;
00183 }
00184
00185
00186
00187
00194 function _initDataAccess()
00195 {
00196 $this->o_dataAccess =& FF_DataAccess::factory('Resolution');
00197 }
00198
00199
00200 }
00201 ?>