Overview

Packages

  • Auth
    • Ads
    • Ldap
    • Xoops
  • Autotasks
  • Config
    • Category
    • Item
    • Option
  • Core
    • Filesystem
    • Filters
    • Logger
    • Mail
    • Message
    • Password
    • Security
    • StopSpammer
    • Template
    • Textsanitizer
    • VersionChecker
  • Data
    • Avatar
    • Comment
  • Database
    • Connection
    • Criteria
    • Legacy
    • MySQL
    • PDO
    • Updater
  • Feeds
    • RSS
  • File
  • Form
    • Base
    • Elements
  • ICMS
    • IPF
      • View
  • Image
    • Category
  • Ipf
    • Category
    • Controller
    • Export
    • form
    • Keyhighlighter
    • Member
    • Object
    • Permission
    • richfile
    • Tree
    • urllink
    • View
  • kernel
    • Set
  • Member
    • Group
    • GroupMembership
    • GroupPermission
    • User
  • Messaging
  • Module
  • None
  • Notification
  • Page
  • Plugins
    • Editor
  • Preload
    • Libraries
  • Privmessage
  • Session
  • SmartObject
  • View
    • Block
    • Breadcrumb
    • PageNav
    • PrinterFriendly
    • Template
    • Templates
    • Theme
    • Tree

Classes

  • icms_ipf_About
  • icms_ipf_Handler
  • icms_ipf_Metagen
  • Overview
  • Package
  • Class

Class icms_ipf_Handler

Persistable Object Handlder

icms_core_ObjectHandler
Extended by icms_ipf_Handler

Direct known subclasses

icms_data_file_Handler, icms_data_page_Handler, icms_data_urllink_Handler, icms_ipf_category_Handler, icms_view_block_Handler, icms_view_block_position_Handler
Package: Ipf
Category: ICMS
Copyright: The ImpressCMS Project http://www.impresscms.org/
License: GNU General Public License (GPL)
Author: marcan marcan@impresscms.org
Author: This was inspired by Mithrandir PersistableObjectHanlder: Jan Keller Pedersen mithrandir@xoops.org - IDG Danmark A/S <www.idg.dk>
Author: Gustavo Alejandro Pilla (aka nekro) nekro@impresscms.org gpilla@nubee.com.ar
Since: 1.1
Located at ipf/Handler.php
Methods summary
public object
# __construct( object & $db, string $itemname, string $keyname, string $idenfierName, string $summaryName, string $modulename )

Constructor - called from child classes

Constructor - called from child classes

Parameters

$db
Database object XoopsDatabase
$itemname
Object to be managed
$keyname
Name of the table key that uniquely identify each icms_ipf_Object
$idenfierName
Name of the field which properly identify the icms_ipf_Object
$summaryName
Name of the field which will be use as a summary for the object
$modulename
Directory name of the module controlling this object

Returns

object

Overrides

icms_core_ObjectHandler::__construct()
public
# addEventHook( str $event, str $method )

Parameters

$event
$method
public
# addPermission( string $perm_name, string $caption, string $description = false )

Add a permission that this handler will manage for its objects

Add a permission that this handler will manage for its objects

Example : $this->addPermission('view', _AM_SSHOP_CAT_PERM_READ, _AM_SSHOP_CAT_PERM_READ_DSC);

Parameters

$perm_name
name of the permission
$caption
caption of the control that will be displayed in the form
$description
description of the control that will be displayed in the form
public
# setGrantedObjectsCriteria( obj & $criteria, str $perm_name )

Parameters

$criteria
$perm_name
public object &
# create( boolean $isNew = true )

create a new icms_ipf_Object

create a new icms_ipf_Object

Parameters

$isNew
Flag the new objects as "new"?

Returns

object
icms_ipf_Object
public
# getImageUrl( )
public
# getImagePath( )
public mixed &
# get( mixed $id, boolean $as_object = true, $debug = false, $criteria = false )

retrieve a icms_ipf_Object

retrieve a icms_ipf_Object

Parameters

$id
ID of the object - or array of ids for joint keys. Joint keys MUST be given in the same order as in the constructor
$as_object
whether to return an object or an array
$debug
$criteria

Returns

mixed
reference to the icms_ipf_Object, FALSE if failed
public mixed &
# getD( mixed $id, boolean $as_object = true )

retrieve a icms_ipf_Object

retrieve a icms_ipf_Object

Parameters

$id
ID of the object - or array of ids for joint keys. Joint keys MUST be given in the same order as in the constructor
$as_object
whether to return an object or an array

Returns

mixed
reference to the icms_ipf_Object, FALSE if failed
public array
# getObjects( object $criteria = null, boolean $id_as_key = false, boolean $as_object = true, $sql = false, $debug = false )

retrieve objects from the database

retrieve objects from the database

Parameters

$criteria
icms_db_criteria_Element conditions to be met
$id_as_key
use the ID as key for the array?
$as_object
return an array of objects?
$sql
$debug

Returns

array
public array
# query( string $sql, object $criteria, boolean $force = false, boolean $debug = false )

query the database with the constructed $criteria object

query the database with the constructed $criteria object

Parameters

$sql
The SQL Query
$criteria
icms_db_criteria_Element conditions to be met
$force
Force the query?
$debug
Turn Debug on?

Returns

array
public array
# getObjectsD( object $criteria = null, boolean $id_as_key = false, boolean $as_object = true, $sql = false )

retrieve objects with debug mode - so will show the query

retrieve objects with debug mode - so will show the query

Parameters

$criteria
icms_db_criteria_Element conditions to be met
$id_as_key
use the ID as key for the array?
$as_object
return an array of objects?
$sql

Returns

array
public
# getObjectsAsArray( arr $arrayObjects )

Parameters

$arrayObjects
public array
# convertResultSet( object $result, boolean $id_as_key = false, boolean $as_object = true )

Convert a database resultset to a returnable array

Convert a database resultset to a returnable array

Parameters

$result
database resultset
$id_as_key
  • should NOT be used with joint keys
$as_object

Returns

array
public array
# getListD( object $criteria = null, integer $limit = 0, integer $start = 0 )

Parameters

$criteria
$limit
$start

Returns

array
public array
# getList( object $criteria = null, integer $limit = 0, integer $start = 0, $debug = false )

Retrieve a list of objects as arrays - DON'T USE WITH JOINT KEYS

Retrieve a list of objects as arrays - DON'T USE WITH JOINT KEYS

Parameters

$criteria
icms_db_criteria_Element conditions to be met
$limit
Max number of objects to fetch
$start
Which record to start at
$debug

Returns

array
public integer
# getCount( object $criteria = null )

count objects matching a condition

count objects matching a condition

Parameters

$criteria
icms_db_criteria_Element to match

Returns

integer
count of objects
public boolean
# delete( object & $obj, boolean $force = false )

delete an object from the database

delete an object from the database

Parameters

$obj
reference to the object to delete
$force

Returns

boolean
FALSE if failed.
public
# disableEvent( arr|str $event )

Parameters

$event
public
# getIdsFromObjectsAsArray( array $objectsAsArray )

Build an array containing all the ids of an array of objects as array

Build an array containing all the ids of an array of objects as array

Parameters

$objectsAsArray
array of icms_ipf_Object
public
# getPermissions( )

Accessor for the permissions array property

Accessor for the permissions array property

public boolean
# insert( object & $obj, boolean $force = false, boolean $checkObject = true, $debug = false )

insert a new object in the database

insert a new object in the database

Parameters

$obj
reference to the object
$force
whether to force the query execution despite security settings
$checkObject
check if the object is dirty and clean the attributes
$debug

Returns

boolean
FALSE if failed, TRUE if already present and unchanged or successful
public
# insertD( obj & $obj, boolean $force = false, boolean $checkObject = true, boolean $debug = false )

Parameters

$obj
$force
$checkObject
$debug
public boolean
# updateAll( string $fieldname, string $fieldvalue, object $criteria = null, $force = false )

Change a value for objects with a certain criteria

Change a value for objects with a certain criteria

Parameters

$fieldname
Name of the field
$fieldvalue
Value to write
$criteria
icms_db_criteria_Element
$force

Returns

boolean
public boolean
# deleteAll( object $criteria = NULL )

delete all objects meeting the conditions

delete all objects meeting the conditions

Parameters

$criteria
icms_db_criteria_Element with conditions to meet

Returns

boolean
public
# getModuleInfo( )
public
# getModuleConfig( )
public
# getModuleItemString( )
public
# updateCounter( $object )

Parameters

$object
public mixed
# executeEvent( string $event, object & $executeEventObj )

Execute the function associated with an event This method will check if the function is available

Execute the function associated with an event This method will check if the function is available

Parameters

$event
name of the event
$executeEventObj
$obj $object on which is performed the event

Returns

mixed
result of the execution of the function or FALSE if the function was not executed
public
# getIdentifierName( boolean $withprefix = true )

Parameters

$withprefix
public
# enableUpload( unknown_type $allowedMimeTypes = false, unknown_type $maxFileSize = false, unknown_type $maxWidth = false, unknown_type $maxHeight = false )

Parameters

$allowedMimeTypes
$maxFileSize
$maxWidth
$maxHeight
public VOID
# setUploaderConfig( str $_uploadPath = false, array $_allowedMimeTypes = false, integer $_maxFileSize = false, integer $_maxWidth = false, integer $_maxHeight = false )

Set the uploader config options.

Set the uploader config options.

Deprecated

please use enableUpload() instead

Parameters

$_uploadPath
$_allowedMimeTypes
$_maxFileSize
$_maxWidth
$_maxFileWidth
$_maxHeight
$_maxFileHeight

Returns

VOID
Properties summary
public string $_itemname

The name of the IPF object

#
public string $table

Name of the table use to store this icms_ipf_Object

Name of the table use to store this icms_ipf_Object

Note that the name of the table needs to be free of the database prefix. For example "smartsection_categories"

#
public string $keyName

Name of the table key that uniquely identify each icms_ipf_Object

Name of the table key that uniquely identify each icms_ipf_Object

For example : "categoryid"

#
public string $className

Name of the class derived from icms_ipf_Object and which this handler is handling

Name of the class derived from icms_ipf_Object and which this handler is handling

Note that this string needs to be lowercase

For example : "smartsectioncategory"

#
public string $identifierName

Name of the field which properly identify the icms_ipf_Object

Name of the field which properly identify the icms_ipf_Object

For example : "name" (this will be the category's name)

#
public string $summaryName

Name of the field which will be use as a summary for the object

Name of the field which will be use as a summary for the object

For example : "summary"

#
public string $_page

Page name use to basically manage and display the icms_ipf_Object

Page name use to basically manage and display the icms_ipf_Object

This page needs to be the same in user side and admin side

For example category.php - we will deduct smartsection/category.php as well as smartsection/admin/category.php

#
public string $_modulePath

Full path of the module using this icms_ipf_Object

Full path of the module using this icms_ipf_Object

ICMS_URL . "/modules/smartsection/"
#
public $_moduleUrl
#
public string $_moduleName

The name of the module for the object

#
public boolean $uploadEnabled
# false
public $_uploadUrl
#
public $_uploadPath
#
public integer $_allowedMimeTypes
# 0
public integer $_maxFileSize
# 1000000
public integer $_maxWidth
# 500
public integer $_maxHeight
# 500
public array $highlightFields
# array()
public array $eventArray

Array containing the events name and functions

Array containing the events name and functions

# array()
public array $permissionsArray

Array containing the permissions that this handler will manage on the objects

Array containing the permissions that this handler will manage on the objects

# false
public boolean $generalSQL
# false
public array $_eventHooks
# array()
public array $_disabledEvents
# array()
Properties inherited from icms_core_ObjectHandler
$db
API documentation generated by ApiGen