Model/PortalBlock.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_PortalBlock
00029 
00040 // }}}
00041 class FF_Model_PortalBlock extends FF_Model {
00042     // {{{ properties
00043 
00048     var $name;
00049 
00054     var $content;
00055 
00060     var $nl2br = false;
00061 
00062     // }}}
00063     // {{{ reset()
00064 
00071     function reset()
00072     {
00073         $this->id = null;
00074         $this->name = null;
00075         $this->content = null;
00076         $this->nl2br = false;
00077     }
00078 
00079     // }}}
00080     // {{{ importFromArray()
00081 
00090     function importFromArray($in_data)
00091     {
00092         $this->setId($in_data['id']);
00093         $this->setName($in_data['name']);
00094         $this->setContent($in_data['content']);
00095         $this->setNl2Br($in_data['nl2br']);
00096     }
00097 
00098     // }}}
00099     // {{{ exportToArray()
00100 
00109     function exportToArray()
00110     {
00111         $a_data = array();
00112         $a_data['id'] = $this->getId();
00113         $a_data['name'] = $this->getName();
00114         $a_data['content'] = $this->getContent();
00115         $a_data['nl2br'] = $this->getNl2Br();
00116         return $a_data;
00117     }
00118 
00119     // }}}
00120     // {{{ getName()
00121 
00122     function getName()
00123     {
00124         return $this->name;
00125     }
00126 
00127     // }}}
00128     // {{{ setName()
00129 
00130     function setName($in_value)
00131     {
00132         $this->name = $in_value;
00133     }
00134 
00135     // }}}
00136     // {{{ getContent()
00137 
00138     function getContent($in_replacePortalLink = false)
00139     {
00140         if ($in_replacePortalLink) {
00141             return preg_replace('/portal:([[:digit:]]+)/e', 'FastFrame::selfURL(array(
00142                             "actionId" => ACTION_DISPLAY, "app" => "portal", session_name() => session_id(),
00143                             "module" => "PortalBlock", "objectId" => "\\1"))', $this->content);
00144         }
00145         else {
00146             return $this->content;
00147         }
00148     }
00149 
00150     // }}}
00151     // {{{ setContent()
00152 
00153     function setContent($in_value)
00154     {
00155         $this->content = $in_value;
00156     }
00157 
00158     // }}}
00159     // {{{ getNl2Br()
00160 
00161     function getNl2Br()
00162     {
00163         return $this->nl2br;
00164     }
00165 
00166     // }}}
00167     // {{{ setNl2Br()
00168 
00169     function setNl2Br($in_value)
00170     {
00171         $this->nl2br = $this->_scalarToBool($in_value);
00172     }
00173 
00174     // }}}
00175     // {{{ _initDataAccess()
00176 
00183     function _initDataAccess()
00184     {
00185         $this->o_dataAccess =& FF_DataAccess::factory('PortalBlock');
00186     }
00187 
00188     // }}}
00189 }
00190 ?>

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