CaMykS  1.0-20181201
 All Classes Files Functions Variables Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ModuleLibrary Class Reference
Inheritance diagram for ModuleLibrary:
Inheritance graph
[legend]

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)
 
 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)
 
 check_SQLCondition ($where, $localeOnly=false)
 

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 class.

Author
CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Constructor & Destructor Documentation

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

Class constructor.

Parameters
integer$id
Object$module
mixed$wf_version

Member Function Documentation

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@
ModuleLibrary::build_SQLCondition (   $params)

Build SQL condition.

Parameters
array$params
Returns
string
ModuleLibrary::check_data ( )

Check content data validity (to be overwritten).

Returns
boolean result
ModuleLibrary::check_databaseInstallation ( )

Check if table is installed.

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

Replace id reference in test string for joined SQL query.

Parameters
string$where
boolean$localeOnly
Returns
string
ModuleLibrary::create_DBTable (   $name,
  $fields,
  $charset = 'utf8' 
)

Create a table in database.

Parameters
string$name
array$fields
string$charset
Returns
boolean success
ModuleLibrary::delete ( )

Delete object.

Returns
boolean success
ModuleLibrary::delete_databaseItems ( )

Delete object from database.

Returns
boolean success
ModuleLibrary::delete_databaseLocalisedItems ( )

Delete object localised items from database.

Returns
boolean success
ModuleLibrary::delete_fileItems ( )
ModuleLibrary::delete_fromSession (   $name = 'ObjectData')

Delete object from session.

Parameters
string$name
Returns
void
ModuleLibrary::delete_textItems ( )

Delete text items

Returns
boolean success
ModuleLibrary::escape_string (   $string)

Return espaced string.

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

Execute database query.

Parameters
string$sql
integer$line
integer$file
string$resName
ModuleLibrary::get (   $language = true)

Load object.

Parameters
mixed$language
Returns
boolean success
ModuleLibrary::get_allDatabaseItems (   $language)

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

Parameters
string$language
Returns
boolean success
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
ModuleLibrary::get_databaseItems ( )

Load object items from database.

Returns
boolean success
ModuleLibrary::get_databaseLocalisedItems ( )

Load database localised items

Returns
boolean success
ModuleLibrary::get_DBInsertExtra ( )

Return latest query affected rows.

Returns
integer
ModuleLibrary::get_DBQueryAffectedRows (   $resName = null)

Return latest query affected rows.

Parameters
string$resName
Returns
integer
ModuleLibrary::get_DBQueryDataLine (   $resName = null)

Return next query data line.

Parameters
string$resName
Returns
integer
ModuleLibrary::get_DBQueryError (   $resName = null)

Return latest query error.

Parameters
string$resName
Returns
string
ModuleLibrary::get_DBQueryGeneratedId (   $resName = null)

Return id generated by last query.

Parameters
string$resName
Returns
integer
ModuleLibrary::get_DBQueryNumDataLine (   $resName = null)

Return next query data line with numeric index.

Parameters
string$resName
Returns
integer
ModuleLibrary::get_fileItems (   $language = null)
ModuleLibrary::get_fileURL (   $file,
  $full = true,
  $default = '' 
)

Return complete file url.

Parameters
string$file
boolean$full
string$default
Returns
string
ModuleLibrary::get_fromArray (   $data,
  $match = null,
  $onlyAvailable = false 
)

Load each item value from an array

Parameters
array$data
array$match
boolean$onlyAvailable
Returns
void
ModuleLibrary::get_fromHeader (   $prefix = '')

Load object from header POST/GET values

Parameters
string$prefix
Returns
void
ModuleLibrary::get_fromItems ( )

Export vars to be easily usable.

Returns
void
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
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
& ModuleLibrary::get_newObject (   $id = 0)

Return a new object.

Parameters
integer$id
Returns
Object
ModuleLibrary::get_objectCount (   $where = '',
  $language = false 
)

Return object count.

Parameters
string$where
mixed$language
Returns
integer
ModuleLibrary::get_objectIdList (   $language = false,
  $where = '',
  $orderBy = '',
  $orderWay = 'asc' 
)

Return object id list.

Parameters
mixed$language
string$where
string$orderBy
string$orderWay
Returns
array
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
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
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
ModuleLibrary::get_objectList_databaseLocalisedItemsSQLQuery (   $ids)

Return SQL query for database localised items object list gathering.

Parameters
array$ids
Returns
string
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
ModuleLibrary::get_tempItems ( )
ModuleLibrary::get_textItems (   $language = null)

Load text files path

Parameters
string$language
Returns
boolean success
ModuleLibrary::get_translation (   $str,
  $args = null 
)

Return localised string.

Parameters
string$str
mixed$args
Returns
string
ModuleLibrary::get_uniqueItemList (   $element = 'name',
  $where = '',
  $structured = false 
)

Return unique item values list.

Parameters
string$element
string$where
boolean$structured
Returns
array
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
ModuleLibrary::get_varFileURL (   $file,
  $full = true,
  $default = '' 
)

Return plugin var file.

Parameters
string$file
boolean$full
string$default
Returns
string
ModuleLibrary::init_library ( )

Finish library object initialisation.

Returns
void
ModuleLibrary::initialise ( )

Initialise new object.

Returns
boolean success
ModuleLibrary::insert_databaseItems ( )
private

Create object instance into database.

Returns
boolean success
ModuleLibrary::install ( )

Install object.

Returns
boolean success
ModuleLibrary::install_databaseItems ( )

Install table in database.

Returns
boolean success
ModuleLibrary::install_databaseLocalisedItems ( )

Install object localised items.

Returns
boolean success
ModuleLibrary::install_fileItems ( )
ModuleLibrary::install_textItems ( )

Install text items folders.

Returns
boolean success
ModuleLibrary::is_installed ( )

Check if object is installed.

Returns
boolean result
ModuleLibrary::is_marked ( )

Check if object is marked, to be overwrite.

Returns
boolean result
ModuleLibrary::load_file (   $file)

Load a file.

Parameters
string$file
Returns
void
ModuleLibrary::load_fromSession (   $name = 'ObjectData',
  $onlyAvailable = false 
)

Load object data from session.

Parameters
string$name
boolean$onlyAvailable
Returns
void
ModuleLibrary::load_varFile (   $file)

Return file from var plugin folder.

Parameters
string$file
Returns
string
ModuleLibrary::ModuleLibrary (   $id,
$module,
  $wf_version = false 
)

Old style constructor.

Parameters
integer$id
Object$module
mixed$wf_version
ModuleLibrary::reset ( )

Delete all objects.

Returns
boolean success
ModuleLibrary::reset_databaseItems ( )

Reset all objects from database

Returns
boolean success
ModuleLibrary::reset_databaseLocalisedItems ( )

Reset objects localised items from database.

Returns
boolean success
ModuleLibrary::reset_fileItems ( )
ModuleLibrary::reset_textItems ( )

Reset text items.

Returns
boolean success
ModuleLibrary::save ( )

Save object.

Returns
boolean success
ModuleLibrary::save_databaseItems ( )

Save object database items.

Returns
boolean success
ModuleLibrary::save_databaseLocalisedItems ( )

Save database localised items.

Returns
boolean success
ModuleLibrary::save_fileItems ( )
ModuleLibrary::save_textItems ( )

Save text items

Returns
boolean success
ModuleLibrary::save_toSession (   $name = 'ObjectData')

Save object data in session.

Parameters
string$name
Returns
void
ModuleLibrary::uninstall ( )

Uninstall object

Returns
boolean success.
ModuleLibrary::uninstall_databaseItems ( )

Delete table from database

Returns
boolean success
ModuleLibrary::update_databaseItems ( )
private

Update object values to database

Returns
boolean success
ModuleLibrary::update_databaseSpecificItems (   $updatedItems)

Update specific items values from object to database.

Parameters
array$updatedItems
Returns
boolean success

Member Data Documentation

Database_connection ModuleLibrary::$_libDBConnector
protected

Database connection.

string ModuleLibrary::$_libDesc

Library description.

boolean ModuleLibrary::$_libError

Last error.

Is library installed.

ModuleLibrary::$_libIsInstalled = null
array ModuleLibrary::$_libItems = array()

Object item list.

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

Object item list by type.

string ModuleLibrary::$_libName

Object name.

Module ModuleLibrary::$_libParent

Parent module.

string ModuleLibrary::$_libParentFile
protected

Object library file.

ModuleLibrary::$_libSQLLocaleTable
string ModuleLibrary::$_libSQLTable

Object table name in database.

Object table name for localised data in database.

integer ModuleLibrary::$id

Object instance id.

string ModuleLibrary::$object_type = 'ModuleLibrary'

Object type.

array ModuleLibrary::$vars = array()

Object item values.


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