<?php
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// WebSite: http://www.rvglobalsoft.com
// Unauthorized copying is strictly forbidden and may result in severe legal action.
// Copyright (c) 2006 RV Global Soft Co.,Ltd. All rights reserved.
//
// =====YOU MUST KEEP THIS COPYRIGHTS NOTICE INTACT AND CAN NOT BE REMOVE =======
// Copyright (c) 2006 RV Global Soft Co.,Ltd. All rights reserved.
// This Agreement is a legal contract, which specifies the terms of the license
// and warranty limitation between you and RV Global Soft Co.,Ltd. and RV Site Builder.
// You should carefully read the following terms and conditions before
// installing or using this software. Unless you have a different license
// agreement obtained from RV Global Soft Co.,Ltd., installation or use of this software
// indicates your acceptance of the license and warranty limitation terms
// contained in this Agreement. If you do not agree to the terms of this
// Agreement, promptly delete and destroy all copies of the Software.
//
// ===== Grant of License =======
// The Software may only be installed and used on a single host machine.
//
// ===== Disclaimer of Warranty =======
// THIS SOFTWARE AND ACCOMPANYING DOCUMENTATION ARE PROVIDED "AS IS" AND
// WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER
// WARRANTIES WHETHER EXPRESSED OR IMPLIED. BECAUSE OF THE VARIOUS HARDWARE
// AND SOFTWARE ENVIRONMENTS INTO WHICH RV SITE BUILDER MAY BE USED, NO WARRANTY OF
// FITNESS FOR A PARTICULAR PURPOSE IS OFFERED. THE USER MUST ASSUME THE
// ENTIRE RISK OF USING THIS PROGRAM. ANY LIABILITY OF RV GLOBAL SOFT CO.,LTD. WILL BE
// LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.
// IN NO CASE SHALL RV GLOBAL SOFT CO.,LTD. BE LIABLE FOR ANY INCIDENTAL, SPECIAL OR
// CONSEQUENTIAL DAMAGES OR LOSS, INCLUDING, WITHOUT LIMITATION, LOST PROFITS
// OR THE INABILITY TO USE EQUIPMENT OR ACCESS DATA, WHETHER SUCH DAMAGES ARE
// BASED UPON A BREACH OF EXPRESS OR IMPLIED WARRANTIES, BREACH OF CONTRACT,
// NEGLIGENCE, STRICT TORT, OR ANY OTHER LEGAL THEORY. THIS IS TRUE EVEN IF
// RV GLOBAL SOFT CO.,LTD. IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO CASE WILL
// RV GLOBAL SOFT CO.,LTD.'S LIABILITY EXCEED THE AMOUNT OF THE LICENSE FEE ACTUALLY PAID
// BY LICENSEE TO RV GLOBAL SOFT CO.,LTD.
// +---------------------------------------------------------------------------+
// $Id$
// +---------------------------------------------------------------------------+
/**
* Data access methods for the font of RVSiteBuilder
*
* @package sitebuilder
* @author Pairote Manunphol <pairote@rvglobalsoft.com>
* @author Parinya <parinya@rvglobalsoft.com>
* @version $Revision$
* @since PHP 5.1
*/
class FontDao extends DbWrapper implements SitebuilderInf
{
function FontDao()
{
parent::DbWrapper();
}
/**
* Returns a singleton FontDao instance.
*
* @param bool $autoload
* @return obj
*/
public static function singleton($autoload=false)
{
static $instance;
// If the instance is not there, create one
if (!isset($instance) || $autoload) {
$class = __CLASS__;
$instance = new $class();
}
return $instance;
}
/**
* find Font data from table 'rvs_font' by font_id
*
* Resulting SQL
* SELECT
* *
* FROM
* rvs_font
* WHERE
* font_id = {$fontId}
*
* @access public
* @author Witoon Jansri
* @param string $fontId
* @param string $fecthMode; getassoc, getall, getrow, getarray
*
* @return <array obj>
*/
public function findFontDataByFontId($fontId=null, $fetchMode='getassoc')
{
DB_DataObject::debugLevel();
SGL::logMessage(null, PEAR_LOG_DEBUG);
$oFont = DB_DataObject::factory($this->aConf['table']['rvs_font']);
if (!is_null($fontId))
{
$query = sprintf("
SELECT
*
FROM
%s
WHERE
font_id = %s
"
, $this->aConf['table']['rvs_font']
, RvsLibs_String::quoteSmart($fontId)
);
$oFont->query($query);
}
$aCloneData = array();
while ($oFont->fetch()) {
$aCloneData[] = clone($oFont);
}
DB_DataObject::debugLevel();
return DbWrapper::fetchDatas($oFont->_resultFields, $aCloneData, $fetchMode);
}
/**
* find Font data from table 'rvs_font' OrderBy FontName
*
* @param unknown_type $fetchMode
* @return unknown
*/
public function findAllFontOrderByFontName($fetchMode='getassoc', $cloneId=false)
{
DB_DataObject::debugLevel();
SGL::logMessage(null, PEAR_LOG_DEBUG);
$oFont = DB_DataObject::factory($this->aConf['table']['rvs_font']);
$oFont->orderBy('font_name');
$oFont->find();
$aCloneData = array();
if ($cloneId == false) {
while ($oFont->fetch()) {
$aCloneData[] = clone($oFont);
}
} else {
while ($oFont->fetch()) {
$aCloneData[$oFont->font_id] = clone($oFont);
}
}
return DbWrapper::fetchDatas($oFont->_resultFields, $aCloneData, 'getassoc');
}
/*
$query = "
SELECT
*
FROM
{$this->conf['table']['rvs_font']}
";
if ($fontId) {
$query .= " WHERE
font_id = '$fontId' ";
}
$query .= " ORDER BY
font_name
";
$aFont = $this->dbh->getAssoc($query);
*/
public function findFontDataByFontId3($fontId = null)
{
DB_DataObject::debugLevel();
SGL::logMessage(null, PEAR_LOG_DEBUG);
$oFont = DB_DataObject::factory($this->aConf['table']['rvs_font']);
$query = sprintf('
SELECT
*
FROM
%s
%s
ORDER BY
font_name
'
, $this->aConf['table']['rvs_font']
, !is_null($fontId) ? sprintf(' WHERE font_id = %s ', RvsLibs_String::quoteSmart($fontId))
: ''
);
$oFont->query($query);
$aCloneData = array();
while ($oFont->fetch()) {
$aCloneData[] = clone($oFont);
}
return DbWrapper::fetchDatas($oFont->_resultFields, $aCloneData, 'getassoc');
}
public function backupsql($projectId, $usrId)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$aSQLData = array();
/// Get Project info id By project_id
$oProjectInfoId = DaoFactory::Project()->findProjectInfoDataByProjectId($projectId, 'getDataObject');
foreach ($oProjectInfoId as $key => $val)
{
if (empty($val->font_id)) {
continue;
}
///find font data by font_id
$oFont = $this->findFontDataByFontId($val->font_id, 'getDataObject');
foreach ($oFont as $k => $v) {
$aSQLData[] = DbWrapper::buildSQLFormat($v);
}
}
return $aSQLData;
}
public function deleteProjectOfUserId($projectId, $usrId, $aProjectPageId = array()) {
SGL::logMessage(null, PEAR_LOG_DEBUG);
}
}
?>
Copyright 2K16 - 2K18 Indonesian Hacker Rulez