Model/Resolution.php

Go to the documentation of this file.
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_Resolution
00029 
00039 // }}}
00040 class FF_Model_Resolution extends FF_Model {
00041     // {{{ properties
00042 
00047     var $name;
00048 
00053     var $isDefault = false;
00054 
00059     var $defaultResponse;
00060 
00061     // }}}
00062     // {{{ reset()
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     // {{{ importFromArray()
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     // {{{ exportToArray()
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     // {{{ getName()
00120 
00121     function getName()
00122     {
00123         return $this->name;
00124     }
00125 
00126     // }}}
00127     // {{{ setName()
00128 
00129     function setName($in_value)
00130     {
00131         $this->name = $in_value;
00132     }
00133 
00134     // }}}
00135     // {{{ getIsDefault()
00136 
00137     function getIsDefault($in_formatted = false)
00138     {
00139         return $in_formatted ? $this->isDefault ? _('Yes') : _('No') : $this->isDefault;
00140     }
00141 
00142     // }}}
00143     // {{{ setIsDefault()
00144 
00145     function setIsDefault($in_value)
00146     {
00147         $this->isDefault = $this->_scalarToBool($in_value);
00148     }
00149 
00150     // }}}
00151     // {{{ getLimitedDefaultResponse()
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     // {{{ getDefaultResponse()
00171 
00172     function getDefaultResponse()
00173     {
00174         return $this->defaultResponse;
00175     }
00176 
00177     // }}}
00178     // {{{ setDefaultResponse()
00179 
00180     function setDefaultResponse($in_value)
00181     {
00182         $this->defaultResponse = $in_value;
00183     }
00184 
00185     // }}}
00186     // {{{ _initDataAccess()
00187 
00194     function _initDataAccess()
00195     {
00196         $this->o_dataAccess =& FF_DataAccess::factory('Resolution');
00197     }
00198 
00199     // }}}
00200 }
00201 ?>

Generated on Fri Jun 23 11:38:17 2006 for FastFrame by  doxygen 1.4.4