CaMykS  1.0-20231201
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ModuleLibrary Class Reference

ModuleLibrary abastract class for module libraries. More...

Inheritance diagram for ModuleLibrary:
Admin_GenericBlogCommentItem Admin_GenericBlogLinkItem Admin_GenericBlogNewsItem Admin_GenericBlogTagItem Admin_GenericContactFormManagerForm Admin_GenericContactFormManagerSubject Admin_GenericDirectoryManagerCategory Admin_GenericDirectoryManagerContact Admin_GenericDownloadManagerCategory Admin_GenericDownloadManagerDocument Admin_GenericEmailingManagerContact Admin_GenericEmailingManagerEmail Admin_GenericEmailingManagerEmailing Admin_GenericFAQManagerFamily Admin_GenericFAQManagerQuestion Admin_GenericGlossaryManagerCategory Admin_GenericGlossaryManagerDefinition Admin_GenericGuestBookManagerMessage Admin_GenericMediaLibraryManagerPicture Admin_GenericMediaLibraryManagerPictureGallery Admin_GenericPetitionManagerPetition Admin_GenericPetitionManagerSignature Admin_GooglePoIMapManagerCategory Admin_GooglePoIMapManagerIcon Admin_GooglePoIMapManagerPoint Admin_InternalMessage Admin_MonitoringUserAgentCheckerRecord Admin_SecurityBackUpFile Admin_SecurityIPFilterRule Admin_SecurityURLFilterRule Admin_SiteReportItem Admin_SiteReportType Admin_Statistic Admin_StatisticConfig Admin_StatisticData Admin_StatisticDatedOptions Admin_StatisticDetailOptions Admin_StatisticMixedOptions Admin_StatisticSingleOptions Admin_SystemNotificationsWebsite Admin_SystemReportItem Admin_SystemUniqueIDManagerKey Admin_ToDoComment Admin_ToDoItem Admin_UserListParams Admin_UserShortcut Content_GenericArticleItem Content_GenericBlogsViewerItem Content_GenericFaqItem Content_GenericFaqList Content_GenericGalleryItem Content_GenericGalleryList Content_GenericGlossaryViewerItem Content_GenericGuestBookViewerItem Content_GenericHTMLContentItem Content_GenericHTMLNewsItem Content_GenericHTMLNewsList Content_GenericLegalMentionsItem Content_GenericMenuItem Content_GenericNewsItem Content_GenericNewsList Content_GenericPageListItem Content_GenericPageRedirectorItem Content_GenericPetitionViewerItem Content_GenericQuickMessageItem Content_GenericQuickMessageList Content_GenericSiteMapItem Content_GoogleMapsViewerItem Content_GooglePoIMapViewerItem Content_GoogleSearchResultsViewerItem Content_TwitterStatusesViewerItem GenericRandomTextItem GenericRandomTextList ModuleLibraryJoin Tool_InstallerParams

Public Member Functions

 __construct ($id, &$module, $wf_version=false)
 
 ModuleLibrary ($id, &$module, $wf_version=false)
 
 init_library ()
 
 initialise ()
 
 get ($language=true)
 
 get_fromHeader ($prefix='')
 
 save ()
 
 delete ()
 
 reset ()
 
 install ()
 
 uninstall ()
 
 is_installed ()
 
 is_marked ()
 
get_newObject ($id=0)
 
 get_databaseItems ()
 
 save_databaseItems ()
 
 delete_databaseItems ()
 
 reset_databaseItems ()
 
 install_databaseItems ()
 
 uninstall_databaseItems ()
 
 check_databaseInstallation ()
 
 get_objectList_databaseItemsSQLQuery ($where='', $limit=-1, $count=-1, $order='id', $sens='')
 
 update_databaseSpecificItems ($updatedItems)
 
 get_databaseLocalisedItems ()
 
 save_databaseLocalisedItems ()
 
 delete_databaseLocalisedItems ()
 
 reset_databaseLocalisedItems ()
 
 install_databaseLocalisedItems ()
 
 get_objectList_databaseLocalisedItemsSQLQuery ($ids)
 
 get_allDatabaseItems ($language)
 
 get_objectList_allDatabaseItemsSQLQuery ($language, $where='', $limit=-1, $count=-1, $order='id', $sens='')
 
 get_textItems ($language=null)
 
 save_textItems ()
 
 delete_textItems ()
 
 reset_textItems ()
 
 install_textItems ()
 
 get_fileItems ($language=null)
 
 save_fileItems ()
 
 delete_fileItems ()
 
 reset_fileItems ()
 
 install_fileItems ()
 
 get_tempItems ()
 
 get_fromArray ($data, $match=null, $onlyAvailable=false)
 
 get_fromItems ()
 
 check_data ()
 
 load_fromSession ($name='ObjectData', $onlyAvailable=false)
 
 save_toSession ($name='ObjectData')
 
 delete_fromSession ($name='ObjectData')
 
 get_fileURL ($file, $full=true, $default='')
 
 load_file ($file)
 
 get_varFileURL ($file, $full=true, $default='')
 
 load_varFile ($file)
 
 get_translation ($str, $args=null)
 
 build_SQLCondition ($params)
 
 get_objectList ($language=false, $where='', $limit=-1, $count=-1, $order='id', $sens='')
 
 get_objectIdList ($language=false, $where='', $orderBy='', $orderWay='asc')
 
 get_nameList ($element='name', $where='', $language='', $orderBy='', $orderWay='asc')
 
 get_objectCount ($where='', $language=false)
 
 get_uniqueItemList ($element='name', $where='', $structured=false)
 
 execute_DBQuery ($sql='', $line=-1, $file='', $resName=null)
 
 execute_DBMultiQueries ($sql='', $line=-1, $file='', $resName=null)
 
 get_DBQueryGeneratedId ($resName=null)
 
 get_DBQueryDataLine ($resName=null)
 
 get_DBQueryNumDataLine ($resName=null)
 
 get_DBQueryError ($resName=null)
 
 get_DBQueryAffectedRows ($resName=null)
 
 escape_string ($string)
 
 get_DBInsertExtra ()
 
 create_DBTable ($name, $fields, $charset='utf8')
 

Public Attributes

 $object_type = 'ModuleLibrary'
 Object type. More...
 
 $_libName
 Object name. More...
 
 $_libParent
 Parent module. More...
 
 $_libItems = array()
 Object item list. More...
 
 $_libItemTypes = array('db' => array(), 'dbl' => array(), 'text' => array(), 'file' => array(), 'temp' => array())
 Object item list by type. More...
 
 $_libSQLTable
 Object table name in database. More...
 
 $_libSQLLocaleTable
 
 $_libDesc
 Library description. More...
 
 $_libError
 Last error. More...
 
 $_libIsInstalled = null
 
 $id
 Object instance id. More...
 
 $vars = array()
 Object item values. More...
 

Protected Member Functions

 add_newItem ($name, $itemtype, $info0, $info1, $info2, $default=null, $localised=false)
 
 insert_multiObjectsDatabaseItems ($keys, $values)
 
 check_SQLCondition ($where, $localeOnly=false)
 
 build_SQLOrderByStatement ($order, $way='')
 

Protected Attributes

 $_libParentFile
 Object library file. More...
 
 $_libDBConnector
 Database connection. More...
 

Private Member Functions

 insert_databaseItems ()
 
 update_databaseItems ()
 
 get_quickObjectList ($where='', $limit=-1, $count=-1, $order='id', $sens='')
 
 get_unlocalisedObjectList ($where='', $limit=-1, $count=-1, $order='id', $sens='')
 
 get_completeObjectList ($where='', $limit=-1, $count=-1, $order='id', $sens='')
 
 get_localisedObjectList ($language=null, $where='', $limit=-1, $count=-1, $order='id', $sens='')
 

Detailed Description

ModuleLibrary abastract class for module libraries.

Engine / Object Library

Author
CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Version
1.0.4.1
Date
Creation: Mar 2007
Modification: May 2021
Note
This program is distributed as is - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Use to manage localised (or not) content from database, files or text objects ModuleLibrary class.

Constructor & Destructor Documentation

◆ __construct()

ModuleLibrary::__construct (   $id,
$module,
  $wf_version = false 
)

Class constructor.

Parameters
integer$id
Object$module
mixed$wf_version

Member Function Documentation

◆ ModuleLibrary()

ModuleLibrary::ModuleLibrary (   $id,
$module,
  $wf_version = false 
)

Old style constructor.

Parameters
integer$id
Object$module
mixed$wf_version

◆ init_library()

ModuleLibrary::init_library ( )

Finish library object initialisation.

Returns
void

◆ add_newItem()

ModuleLibrary::add_newItem (   $name,
  $itemtype,
  $info0,
  $info1,
  $info2,
  $default = null,
  $localised = false 
)
protected

Insert a new item in object.

Parameters
string$name
string$itemtype
string$info0
string$info1
mixed$info2
mixed$default
boolean$localised@

◆ initialise()

ModuleLibrary::initialise ( )

◆ get()

ModuleLibrary::get (   $language = true)

Load object.

Parameters
mixed$language
Returns
boolean success

Reimplemented in Content_GenericLegalMentionsItem, and Admin_ToDoItem.

◆ get_fromHeader()

ModuleLibrary::get_fromHeader (   $prefix = '')

Load object from header POST/GET values

Parameters
string$prefix
Returns
void

◆ save()

ModuleLibrary::save ( )

◆ delete()

ModuleLibrary::delete ( )

Delete object.

Returns
boolean success

Reimplemented in GenericRandomTextItem, and Admin_GenericMediaLibraryManagerPictureGallery.

◆ reset()

ModuleLibrary::reset ( )

Delete all objects.

Returns
boolean success

◆ install()

ModuleLibrary::install ( )

Install object.

Returns
boolean success

◆ uninstall()

ModuleLibrary::uninstall ( )

Uninstall object

Returns
boolean success.

◆ is_installed()

ModuleLibrary::is_installed ( )

Check if object is installed.

Returns
boolean result

◆ is_marked()

ModuleLibrary::is_marked ( )

Check if object is marked, to be overwrite.

Returns
boolean result

Reimplemented in Admin_SystemReportItem.

◆ get_newObject()

& ModuleLibrary::get_newObject (   $id = 0)

Return a new object.

Parameters
integer$id
Returns
Object

Reimplemented in ModuleLibraryJoin.

◆ get_databaseItems()

ModuleLibrary::get_databaseItems ( )

Load object items from database.

Returns
boolean success

◆ save_databaseItems()

ModuleLibrary::save_databaseItems ( )

Save object database items.

Returns
boolean success

◆ insert_databaseItems()

ModuleLibrary::insert_databaseItems ( )
private

Create object instance into database.

Returns
boolean success

◆ insert_multiObjectsDatabaseItems()

ModuleLibrary::insert_multiObjectsDatabaseItems (   $keys,
  $values 
)
protected

Create multi object instances into database.

Parameters
array$keys
array$values
Returns
boolean success

◆ update_databaseItems()

ModuleLibrary::update_databaseItems ( )
private

Update object values to database

Returns
boolean success

Reimplemented in Admin_SiteReportItem.

◆ delete_databaseItems()

ModuleLibrary::delete_databaseItems ( )

Delete object from database.

Returns
boolean success

◆ reset_databaseItems()

ModuleLibrary::reset_databaseItems ( )

Reset all objects from database

Returns
boolean success

◆ install_databaseItems()

ModuleLibrary::install_databaseItems ( )

Install table in database.

Returns
boolean success

◆ uninstall_databaseItems()

ModuleLibrary::uninstall_databaseItems ( )

Delete table from database

Returns
boolean success

◆ check_databaseInstallation()

ModuleLibrary::check_databaseInstallation ( )

Check if table is installed.

Returns
boolean result

◆ get_objectList_databaseItemsSQLQuery()

ModuleLibrary::get_objectList_databaseItemsSQLQuery (   $where = '',
  $limit = -1,
  $count = -1,
  $order = 'id',
  $sens = '' 
)

Return sql query for database items object list gathering.

Parameters
string$where
int$limit
int$count
string$order
string$sens
Returns
string

◆ update_databaseSpecificItems()

ModuleLibrary::update_databaseSpecificItems (   $updatedItems)

Update specific items values from object to database.

Parameters
array$updatedItems
Returns
boolean success

◆ get_databaseLocalisedItems()

ModuleLibrary::get_databaseLocalisedItems ( )

Load database localised items

Returns
boolean success

◆ save_databaseLocalisedItems()

ModuleLibrary::save_databaseLocalisedItems ( )

Save database localised items.

Returns
boolean success

◆ delete_databaseLocalisedItems()

ModuleLibrary::delete_databaseLocalisedItems ( )

Delete object localised items from database.

Returns
boolean success

◆ reset_databaseLocalisedItems()

ModuleLibrary::reset_databaseLocalisedItems ( )

Reset objects localised items from database.

Returns
boolean success

◆ install_databaseLocalisedItems()

ModuleLibrary::install_databaseLocalisedItems ( )

Install object localised items.

Returns
boolean success

◆ get_objectList_databaseLocalisedItemsSQLQuery()

ModuleLibrary::get_objectList_databaseLocalisedItemsSQLQuery (   $ids)

Return SQL query for database localised items object list gathering.

Parameters
array$ids
Returns
string

◆ get_allDatabaseItems()

ModuleLibrary::get_allDatabaseItems (   $language)

Load database unlocalised and localised items at once for given language.

Parameters
string$language
Returns
boolean success

◆ get_objectList_allDatabaseItemsSQLQuery()

ModuleLibrary::get_objectList_allDatabaseItemsSQLQuery (   $language,
  $where = '',
  $limit = -1,
  $count = -1,
  $order = 'id',
  $sens = '' 
)

Return SQL query for database items object list gathering

Parameters
string$language
string$where
integer$limit
integer$count
mixed$order
string$sens

◆ get_textItems()

ModuleLibrary::get_textItems (   $language = null)

Load text files path

Parameters
string$language
Returns
boolean success

◆ save_textItems()

ModuleLibrary::save_textItems ( )

Save text items

Returns
boolean success

◆ delete_textItems()

ModuleLibrary::delete_textItems ( )

Delete text items

Returns
boolean success

◆ reset_textItems()

ModuleLibrary::reset_textItems ( )

Reset text items.

Returns
boolean success

◆ install_textItems()

ModuleLibrary::install_textItems ( )

Install text items folders.

Returns
boolean success

◆ get_fileItems()

ModuleLibrary::get_fileItems (   $language = null)

◆ save_fileItems()

ModuleLibrary::save_fileItems ( )

◆ delete_fileItems()

ModuleLibrary::delete_fileItems ( )

◆ reset_fileItems()

ModuleLibrary::reset_fileItems ( )

◆ install_fileItems()

ModuleLibrary::install_fileItems ( )

◆ get_tempItems()

ModuleLibrary::get_tempItems ( )

◆ get_fromArray()

ModuleLibrary::get_fromArray (   $data,
  $match = null,
  $onlyAvailable = false 
)

Load each item value from an array

Parameters
array$data
array$match
boolean$onlyAvailable
Returns
void

◆ get_fromItems()

ModuleLibrary::get_fromItems ( )

◆ check_data()

ModuleLibrary::check_data ( )

◆ load_fromSession()

ModuleLibrary::load_fromSession (   $name = 'ObjectData',
  $onlyAvailable = false 
)

Load object data from session.

Parameters
string$name
boolean$onlyAvailable
Returns
void

◆ save_toSession()

ModuleLibrary::save_toSession (   $name = 'ObjectData')

Save object data in session.

Parameters
string$name
Returns
void

◆ delete_fromSession()

ModuleLibrary::delete_fromSession (   $name = 'ObjectData')

Delete object from session.

Parameters
string$name
Returns
void

◆ get_fileURL()

ModuleLibrary::get_fileURL (   $file,
  $full = true,
  $default = '' 
)

Return complete file url.

Parameters
string$file
boolean$full
string$default
Returns
string

◆ load_file()

ModuleLibrary::load_file (   $file)

Load a file.

Parameters
string$file
Returns
void

◆ get_varFileURL()

ModuleLibrary::get_varFileURL (   $file,
  $full = true,
  $default = '' 
)

Return plugin var file.

Parameters
string$file
boolean$full
string$default
Returns
string

◆ load_varFile()

ModuleLibrary::load_varFile (   $file)

Return file from var plugin folder.

Parameters
string$file
Returns
string

◆ get_translation()

ModuleLibrary::get_translation (   $str,
  $args = null 
)

Return localised string.

Parameters
string$str
mixed$args
Returns
string

◆ build_SQLCondition()

ModuleLibrary::build_SQLCondition (   $params)

◆ check_SQLCondition()

ModuleLibrary::check_SQLCondition (   $where,
  $localeOnly = false 
)
protected

Replace id reference in test string for joined SQL query.

Parameters
string$where
boolean$localeOnly
Returns
string

◆ build_SQLOrderByStatement()

ModuleLibrary::build_SQLOrderByStatement (   $order,
  $way = '' 
)
protected

Build order by statement for SQL query.

Parameters
mixed$order
string$way
Returns
string

◆ get_objectList()

ModuleLibrary::get_objectList (   $language = false,
  $where = '',
  $limit = -1,
  $count = -1,
  $order = 'id',
  $sens = '' 
)

Return object list using the most optimised sub method.

Parameters
mixed$language
string$where
integer$limit
integer$count
string$order
string$sens
Returns
array

◆ get_objectIdList()

ModuleLibrary::get_objectIdList (   $language = false,
  $where = '',
  $orderBy = '',
  $orderWay = 'asc' 
)

Return object id list.

Parameters
mixed$language
string$where
string$orderBy
string$orderWay
Returns
array

◆ get_nameList()

ModuleLibrary::get_nameList (   $element = 'name',
  $where = '',
  $language = '',
  $orderBy = '',
  $orderWay = 'asc' 
)

Return items id:element list.

Parameters
string$element
string$where
string$language
string$orderBy
string$orderWay
Returns
array

◆ get_objectCount()

ModuleLibrary::get_objectCount (   $where = '',
  $language = false 
)

Return object count.

Parameters
string$where
mixed$language
Returns
integer

◆ get_quickObjectList()

ModuleLibrary::get_quickObjectList (   $where = '',
  $limit = -1,
  $count = -1,
  $order = 'id',
  $sens = '' 
)
private

get_objectList sub methods : return database items only

Parameters
string$where
integer$limit
integer$count
mixed$order
string$sens
Returns
array

◆ get_unlocalisedObjectList()

ModuleLibrary::get_unlocalisedObjectList (   $where = '',
  $limit = -1,
  $count = -1,
  $order = 'id',
  $sens = '' 
)
private

get_objectList sub methods : return complete items : unlocalised items only

Parameters
string$where
integer$limit
integer$count
mixed$order
string$sens
Returns
array

◆ get_completeObjectList()

ModuleLibrary::get_completeObjectList (   $where = '',
  $limit = -1,
  $count = -1,
  $order = 'id',
  $sens = '' 
)
private

get_objectList sub methods : return complete objects

Parameters
string$where
integer$limit
integer$count
mixed$order
string$sens
Returns
array

◆ get_localisedObjectList()

ModuleLibrary::get_localisedObjectList (   $language = null,
  $where = '',
  $limit = -1,
  $count = -1,
  $order = 'id',
  $sens = '' 
)
private

get_objectList sub methods : return single language objects

Parameters
mixed$language
string$where
integer$limit
integer$count
mixed$order
string$sens
Returns
array

◆ get_uniqueItemList()

ModuleLibrary::get_uniqueItemList (   $element = 'name',
  $where = '',
  $structured = false 
)

Return unique item values list.

Parameters
string$element
string$where
boolean$structured
Returns
array

◆ execute_DBQuery()

ModuleLibrary::execute_DBQuery (   $sql = '',
  $line = -1,
  $file = '',
  $resName = null 
)

Execute database query.

Parameters
string$sql
integer$line
integer$file
string$resName

◆ execute_DBMultiQueries()

ModuleLibrary::execute_DBMultiQueries (   $sql = '',
  $line = -1,
  $file = '',
  $resName = null 
)

Execute multiple database queries at once.

Parameters
string$sql
integer$line
integer$file
string$resName

◆ get_DBQueryGeneratedId()

ModuleLibrary::get_DBQueryGeneratedId (   $resName = null)

Return id generated by last query.

Parameters
string$resName
Returns
integer

◆ get_DBQueryDataLine()

ModuleLibrary::get_DBQueryDataLine (   $resName = null)

Return next query data line.

Parameters
string$resName
Returns
integer

◆ get_DBQueryNumDataLine()

ModuleLibrary::get_DBQueryNumDataLine (   $resName = null)

Return next query data line with numeric index.

Parameters
string$resName
Returns
integer

◆ get_DBQueryError()

ModuleLibrary::get_DBQueryError (   $resName = null)

Return latest query error.

Parameters
string$resName
Returns
string

◆ get_DBQueryAffectedRows()

ModuleLibrary::get_DBQueryAffectedRows (   $resName = null)

Return latest query affected rows.

Parameters
string$resName
Returns
integer

◆ escape_string()

ModuleLibrary::escape_string (   $string)

Return espaced string.

Parameters
string$string
Returns
string

◆ get_DBInsertExtra()

ModuleLibrary::get_DBInsertExtra ( )

Return latest query affected rows.

Returns
integer

◆ create_DBTable()

ModuleLibrary::create_DBTable (   $name,
  $fields,
  $charset = 'utf8' 
)

Create a table in database.

Parameters
string$name
array$fields
string$charset
Returns
boolean success

Member Data Documentation

◆ $object_type

string ModuleLibrary::$object_type = 'ModuleLibrary'

Object type.

◆ $_libName

string ModuleLibrary::$_libName

Object name.

◆ $_libParent

Module ModuleLibrary::$_libParent

Parent module.

◆ $_libParentFile

string ModuleLibrary::$_libParentFile
protected

Object library file.

◆ $_libItems

array ModuleLibrary::$_libItems = array()

Object item list.

◆ $_libItemTypes

array ModuleLibrary::$_libItemTypes = array('db' => array(), 'dbl' => array(), 'text' => array(), 'file' => array(), 'temp' => array())

Object item list by type.

◆ $_libDBConnector

Database_connection ModuleLibrary::$_libDBConnector
protected

Database connection.

◆ $_libSQLTable

string ModuleLibrary::$_libSQLTable

Object table name in database.

Object table name for localised data in database.

◆ $_libSQLLocaleTable

ModuleLibrary::$_libSQLLocaleTable

◆ $_libDesc

string ModuleLibrary::$_libDesc

Library description.

◆ $_libError

boolean ModuleLibrary::$_libError

Last error.

Is library installed.

◆ $_libIsInstalled

ModuleLibrary::$_libIsInstalled = null

◆ $id

integer ModuleLibrary::$id

Object instance id.

◆ $vars

array ModuleLibrary::$vars = array()

Object item values.


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