Cheetah
Public Member Functions | Public Attributes | List of all members
ChPollDb Class Reference
Inheritance diagram for ChPollDb:
ChWsbModuleDb ChWsbDb

Public Member Functions

 __construct (&$oConfig)
 
 getAllPolls ($sLimit, $iMemberID=0, $bAllPolls=false, $iApproval=1, $sExtraSql=null, $sOrder='`poll_date` DESC')
 
 getFeaturedCount ($iStatus=1, $bOnlyPublic=false)
 
 getAllFeaturedPolls ($sLimit, $iStatus=1, $bOnlyPublic=false)
 
 getPollsCount ($iMemberID=0, $bAllPools=false, $iApproval=1, $sExtraSql=null)
 
 getUnApprovedPolls ($iProfileId)
 
 getPollInfo ($iPollId)
 
 setVotes ( $iPollId, $sVotes, $iVotesCount)
 
 setOption ($iPollId, $sAction='approval')
 
 createPoll ($aPoolInfo, $isAdmin=false)
 
 editPoll ($aPoolInfo)
 
 deletePoll ($iPollId)
 
 clearAttachetData ($iPollId)
 
 getPollsByMonth ($iYear, $iMonth, $iNextYear, $iNextMonth)
 
 getSettingsCategory ($sCatName)
 
- Public Member Functions inherited from ChWsbModuleDb
 __construct ($oConfig=null)
 
 getPrefix ()
 
 getModulesBy ($aParams=array())
 
 getModuleById ($iId)
 
 getModuleByUri ($sUri)
 
 isModule ($sUri)
 
 isModuleParamsUsed ($sUri, $sPath, $sPrefixDb, $sPrefixClass)
 
 getModules ()
 
 getDependent ($sUri)
 
 getSettingsCategoryId ($sCatName)
 
- Public Member Functions inherited from ChWsbDb
 setTimezone ($sTimezone)
 
 getLink ()
 
 res ($sQuery, $aBindings=[], $bReplaying=false)
 
 getAll ($sQuery, $aBindings=[], $iFetchType=PDO::FETCH_ASSOC)
 
 getRow ($sQuery, $aBindings=[], $iFetchStyle=PDO::FETCH_ASSOC)
 
 getColumn ($sQuery, $aBindings=[])
 
 getOne ($sQuery, $aBindings=[], $iIndex=0)
 
 getFirstRow ($sQuery, $aBindings=[], $iFetchStyle=PDO::FETCH_ASSOC)
 
 getNextRow ()
 
 getAllWithKey ($sQuery, $sFieldKey, $aBindings=[], $iFetchType=PDO::FETCH_ASSOC)
 
 getPairs ($sQuery, $sFieldKey, $sFieldValue, $aBindings=[])
 
 query ($sQuery, $aBindings=[])
 
 getNumRows ($oStmt=null)
 
 getAffectedRows ($oStmt=null)
 
 fillArray ($oStmt, $iFetchType=PDO::FETCH_ASSOC)
 
 lastId ()
 
 getParam ($sName, $bCache=true)
 
 setParam ($sName, $sValue)
 
 listTables ()
 
 getFields ($sTable)
 
 isFieldExists ($sTable, $sFieldName)
 
 fetchField ($mixedQuery, $iField, $aBindings=[])
 
 getDbCacheObject ()
 
 genDbCacheKey ($sName)
 
 fromCache ($sName, $sFunc)
 
 cleanCache ($sName)
 
fromMemory ($sName, $sFunc)
 
 cleanMemory ($sName)
 
 arrayToSQL ($a, $sDiv=',')
 
 escape ($sText, $bReal=true)
 
 implode_escape ($mixed)
 
 unescape ($mixed)
 

Public Attributes

 $_oConfig
 
 $_sTable
 
 $sTablePrefix
 
- Public Attributes inherited from ChWsbModuleDb
 $_sPrefix
 
- Public Attributes inherited from ChWsbDb
 $port
 
 $socket
 
 $dbname
 
 $user
 
 $password
 
 $oParams = null
 
 $oDbCacheObject = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ChWsbDb
static getInstance ()
 
- Protected Member Functions inherited from ChWsbDb
 __construct ()
 
 connect ()
 
 disconnect ()
 
- Protected Attributes inherited from ChWsbDb
 $host
 
 $link
 
 $oCurrentStmt
 
 $iCurrentFetchStyle
 
- Static Protected Attributes inherited from ChWsbDb
static $instance
 

Detailed Description

This work, "Cheetah - https://www.cheetahwsb.com", is a derivative of "Dolphin Pro V7.4.2" by BoonEx Pty Limited - https://www.boonex.com/, used under CC-BY. "Cheetah" is licensed under CC-BY by Dean J. Bassett Jr. CC-BY License - http://creativecommons.org/licenses/by/3.0/

Definition at line 10 of file ChPollDb.php.

Constructor & Destructor Documentation

◆ __construct()

ChPollDb::__construct ( $oConfig)

Definition at line 19 of file ChPollDb.php.

Member Function Documentation

◆ clearAttachetData()

ChPollDb::clearAttachetData (   $iPollId)

Function will delete all poll's attachet data; from cmts, votings....

@iPollId (integer) - poll's id;

Definition at line 411 of file ChPollDb.php.

◆ createPoll()

ChPollDb::createPoll (   $aPoolInfo,
  $isAdmin = false 
)

Function will create new poll ;

Parameters
:$aPoolInfo(array) - contain some poll's information; [ owner_id ] - (integer) poll's owner Id ; [ question ] - (string) poll's question ; [ answers ] - (string) poll's answers (string separated by tag CH_POLL_ANS_DIVIDER); [ results ] - (string) poll's results (string separated by ';'); [ tags ] - (string) poll's tags (string separated by 'space'); $isAdmin : (boolean) - is isset this value that is admin mode;
Returns
: (integer) - code of operation;

Definition at line 274 of file ChPollDb.php.

◆ deletePoll()

ChPollDb::deletePoll (   $iPollId)

Function will delete poll ;

Parameters
:$iPollId(integer) - poll's Id;
Returns
: (integer) - number of affected rows;

Definition at line 397 of file ChPollDb.php.

◆ editPoll()

ChPollDb::editPoll (   $aPoolInfo)

Function will edit poll ;

Parameters
:$aPoolInfo(array) - contain some poll's information; [ question ] - (string) poll's question ; [ answers ] - (string) poll's answers (string separated by tag CH_POLL_ANS_DIVIDER); [ status ] - (string) poll's status as active or not; [ approve ] - (boolean) poll's approve or not; [ Id ] - (integer) poll's Id; [ tags ] - (string) poll's tags (string separated by 'space');
Returns
: (integer) - number of affected rows;

Definition at line 345 of file ChPollDb.php.

◆ getAllFeaturedPolls()

ChPollDb::getAllFeaturedPolls (   $sLimit,
  $iStatus = 1,
  $bOnlyPublic = false 
)

Function will generate all featured polls;

Parameters
:$bOnlyPublic(boolean) - if isset this param than will return only public polls;
:$sLimit(string) - sql query (limit of returning rows)

Definition at line 113 of file ChPollDb.php.

◆ getAllPolls()

ChPollDb::getAllPolls (   $sLimit,
  $iMemberID = 0,
  $bAllPolls = false,
  $iApproval = 1,
  $sExtraSql = null,
  $sOrder = '`poll_date` DESC' 
)

Function will return all active pools ;

Parameters
:$sLimit(string) - contain part of SQL query;
:$iMemberID(integer) - logged member's Id ;
:$bAllPolls(boolean) - return all polls aprroved and not ;
Returns
: (array) - array with all active pools; [ id_poll ] - (integer) poll's Id; [ id_profile ] - (integer) poll's owner Id; [ poll_date ] - (string) poll's date creation; [ sec ] - (integer) poll's date creation in seconds; [ poll_approval ] - (integer) poll's status aproved or not;

Definition at line 41 of file ChPollDb.php.

◆ getFeaturedCount()

ChPollDb::getFeaturedCount (   $iStatus = 1,
  $bOnlyPublic = false 
)

Function will get number of featured polls

Parameters
:$iStatus(integer) - poll's featured status;
:$bOnlyPublic(boolean) - if isset this param than will return only public polls;
Returns
: (integer) - number of featured polls;

Definition at line 97 of file ChPollDb.php.

◆ getPollInfo()

ChPollDb::getPollInfo (   $iPollId)

Function will return array with all poll's questions ;

Parameters
:$iPollId(integer) - poll's Id ;
Returns
: (array) array with all questions ; [ id_poll ] - (integer) poll's Id; [ id_profile ] - (integer) poll's owner Id; [ poll_date ] - (string) poll's date creation; [ sec ] - (integer) poll's date creation in seconds;

Definition at line 203 of file ChPollDb.php.

◆ getPollsByMonth()

ChPollDb::getPollsByMonth (   $iYear,
  $iMonth,
  $iNextYear,
  $iNextMonth 
)

Function will find all polls by month;

Parameters
:$iYear(integer) - needed year;
:$iMonth(integer) - needed month;
:$iNextYear(integer) - next year;
:$iNextMonth(integer) - next month;
Returns
(array);

Definition at line 460 of file ChPollDb.php.

◆ getPollsCount()

ChPollDb::getPollsCount (   $iMemberID = 0,
  $bAllPools = false,
  $iApproval = 1,
  $sExtraSql = null 
)

Function will return the number of active pools;

Parameters
:$iMemberID(integer) - logged member's Id ;
:$bAllPools(boolean) - if isset this param that will find all member's poll's (approved and not) ;
Returns
: (integer) - number of active pools;

Definition at line 132 of file ChPollDb.php.

◆ getSettingsCategory()

ChPollDb::getSettingsCategory (   $sCatName)

Function will return global category number;

Returns
: (integer) - category's number;

Definition at line 477 of file ChPollDb.php.

◆ getUnApprovedPolls()

ChPollDb::getUnApprovedPolls (   $iProfileId)

Function will get count of unapproved polls;

Parameters
:$iProfileId(integer) - profile's Id;
Returns
: (integer) - number of polls;

Definition at line 185 of file ChPollDb.php.

◆ setOption()

ChPollDb::setOption (   $iPollId,
  $sAction = 'approval' 
)

Function will set poll's status , featured;

Parameters
:$iPollId(integer) - poll's Id ;
Returns
: (integer) - number of affected rows ;

Definition at line 245 of file ChPollDb.php.

◆ setVotes()

ChPollDb::setVotes (   $iPollId,
  $sVotes,
  $iVotesCount 
)

Function will set the number of votes ;

Parameters
:$iPollId(integer) - poll's Id;
:$sVotes(string) - votes string;
:$iVotesCount(integer) - number of all votes;
Returns
: (integer) - number of affected rows ;

Definition at line 219 of file ChPollDb.php.

Member Data Documentation

◆ $_oConfig

ChPollDb::$_oConfig

Definition at line 12 of file ChPollDb.php.

◆ $_sTable

ChPollDb::$_sTable

Definition at line 13 of file ChPollDb.php.

◆ $sTablePrefix

ChPollDb::$sTablePrefix

Definition at line 14 of file ChPollDb.php.


The documentation for this class was generated from the following file: