Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Docs For Class ObjectUtil

Class: ObjectUtil

Source Location: /pnobjlib/ObjectUtil.class.php

Class Overview


ObjectUtil

Methods


Inherited Variables

Inherited Methods


Class Details

[line 20] ObjectUtil



[ Top ]

Class Methods


method addStandardFieldsToTableDataDefinition [line 77]

The addStandardFieldsToTableDataDefinition( columns &$columns)

Generate the ADODB DD field descruptors for the standard PN architecture fields



Tags:

return:  modified list of ADODB DD strings


Parameters:

columns   &$columns   The column list from the PNTables structure for the current table

[ Top ]

method addStandardFieldsToTableDefinition [line 30]

Nothing, addStandardFieldsToTableDefinition( columns &$columns, col_prefix $col_prefix)

Add standard PN architecture fields to the table definition



Tags:

return:  column array is altered in place


Parameters:

columns   &$columns   The column list from the PNTables structure for the current table
col_prefix   $col_prefix   The column prefix

[ Top ]

method createObject [line 219]

The createObject( $type $type)

Create an object of the reuqested type and set the cr_date and cr_uid fields.



Tags:

return:  newly created object


Parameters:

$type   $type   The type of the object to create

[ Top ]

method deleteAllObjectTypeAttributes [line 596]

the deleteAllObjectTypeAttributes( type $type)

Delete the all attributes for the given tab



Tags:

return:  SQL result of the delete operation


Parameters:

type   $type   The type/tablename we wish to delete attributes for

[ Top ]

method deleteObjectAttributes [line 556]

the deleteObjectAttributes( object The &$obj, type $type, [idcolumn $idcolumn = 'id'])

Delete the attributes for the given object.



Tags:

return:  SQL result of the delete operation


Parameters:

object The   &$obj   object whose attributes we wish to store
type   $type   The type of the given object
idcolumn   $idcolumn   The idcolumn of the object (optional) (default='id')

[ Top ]

method deleteObjectCategories [line 907]

The deleteObjectCategories( obj $obj, tablename $tablename, [idcolumn $idcolumn = 'obj_id'])

Delete a meta data object



Tags:

return:  result from the metadata insert operation


Parameters:

obj   $obj   The object we wish to delete categorization data for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='obj_id')

[ Top ]

method deleteObjectMetaData [line 747]

The deleteObjectMetaData( obj &$obj, tablename $tablename, [idcolumn $idcolumn = 'id'])

Delete a meta data object



Tags:

return:  result from the metadata insert operation


Parameters:

obj   &$obj   The object we wish to delete metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')

[ Top ]

method diff [line 243]

The diff( object1 $obj1, object2 $obj2)

Diff 2 objects/arrays



Tags:

return:  difference between the two objects


Parameters:

object1   $obj1   The first array/object
object2   $obj2   The second object/array

[ Top ]

method diffExtended [line 264]

A diffExtended( a1 $a1, a2 $a2, [detail $detail = false], [recurse $recurse = true])

Provide an informative extended diff array when comparing 2 arrays



Tags:

return:  data array containing the diff results


Parameters:

a1   $a1   Array 1
a2   $a2   Array 2
detail   $detail   whether or not to give detailed update info (optional (default=false)
recurse   $recurse   whether or not to recurse (optional) (default=true)

[ Top ]

method expandObjectArrayWithCategories [line 1003]

The expandObjectArrayWithCategories( objArray &$objArray, tablename $tablename, [idcolumn $idcolumn = 'id'], [field $field = 'id'], [ $locale = 'eng'])

Expand an object array with it's category data



Tags:

return:  object with the meta data filled in. The object passed in is altered in place


Parameters:

objArray   &$objArray   The object array we wish to get the category for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')
field   $field   The category field to return the object's category info (optional) (default='id')
   $locale  

[ Top ]

method expandObjectWithAttributes [line 468]

The expandObjectWithAttributes( object The &$obj, type $type, [idcolumn $idcolumn = 'id'])

Expand the given object with it's attributes



Tags:

return:  object which has been altered in place


Parameters:

object The   &$obj   object whose attribute we wish to retrieve
type   $type   The type of the given object
idcolumn   $idcolumn   The column which holds the ID value (optional) (default='id')

[ Top ]

method expandObjectWithCategories [line 1098]

The expandObjectWithCategories( obj &$obj, tablename $tablename, [idcolumn $idcolumn = 'id'], [field $assocKey = ''], assocKey 4)

Expand an object with it's category data



Tags:

return:  object with the meta data filled in. The object passed in is altered in place


Parameters:

assocKey   4   The field to use for the associative array index (optional) (default='id')
obj   &$obj   The object we wish to get the metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')
field   $assocKey   The category field to return the object's category info (optional) (default='id')

[ Top ]

method expandObjectWithMeta [line 816]

The expandObjectWithMeta( obj &$obj, tablename $tablename, [idcolumn $idcolumn = 'id'])

Expand an object with it's Meta data



Tags:

return:  object with the meta data filled in. The object passed in is altered in place


Parameters:

obj   &$obj   The object we wish to get the metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')

[ Top ]

method fixObjectMetaData [line 665]

Altered fixObjectMetaData( obj &$obj, tablename $tablename, idcolumn $idcolumn)

Ensure that a meta-data object has reasonable default values



Tags:

return:  meta object (meta object is also altered in place)


Parameters:

obj   &$obj   The object we wish to store metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')

[ Top ]

method generateCreateDataDictForStandardFields [line 96]

The generateCreateDataDictForStandardFields( $table $table)

Generate the ADODB datadict entries to create the standard PN architecture fields



Tags:

return:  generated SQL string


Parameters:

$table   $table   The table to add standard fields using ADODB dictionary method

[ Top ]

method generateCreateSqlForStandardFields [line 58]

The generateCreateSqlForStandardFields( columns $columns)

Generate the SQL to create the standard PN architecture fields



Tags:

return:  generated SQL string


Parameters:

columns   $columns   The column list from the PNTables structure for the current table

[ Top ]

method getAttributeCount [line 643]

The getAttributeCount( atrName $atrName)

Retrieve the count for a given attribute name



Tags:

return:  count for the given attribute


Parameters:

atrName   $atrName   The name of the attribute

[ Top ]

method getField [line 203]

The getField( object The $obj, field $field, [default $default = null])

If the specified field is set return it, otherwise return default



Tags:

return:  object field value or the default


Parameters:

object The   $obj   object to get the field from
field   $field   The field to get
default   $default   The default value to return if the field is not set on the object (default=null) (optional)

[ Top ]

method getSystemAttributes [line 618]

the getSystemAttributes( [sort $sort = 'attribute_name'])

Retrieve a list of attributes defined in the system



Tags:

return:  system attributes field array


Parameters:

sort   $sort   The column to sort by (optional) (default='attribute_name')

[ Top ]

method insertObjectMetaData [line 694]

The insertObjectMetaData( obj &$obj, tablename $tablename, [idcolumn $idcolumn = 'id'])

Insert a meta data object



Tags:

return:  result from the metadata insert operation


Parameters:

obj   &$obj   The object we wish to store metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')

[ Top ]

method moveField [line 366]

true/false moveField( object The $obj, tablename $tablename, [direction $direction = 'up'], [field $field = 'position'], [idcolumn $idcolumn = 'id'], [field2 $field2 = ''], [value2 $value2 = ''])

Increments or decremnts a sequence number (column position) in a table for a given ID. If exists, it swaps the sequence of the field above or down.



Tags:

return:  on success/failure


Parameters:

object The   $obj   object we wish to increment or decrement
tablename   $tablename   The tablename key for the PNTables structure
direction   $direction   whether we want to increment or decrement the position of the object. Possible values are 'up' (default) and 'down'
field   $field   The name of the field we wish to resequence
idcolumn   $idcolumn   The column which contains the unique ID
field2   $field2   An additional field to consider in the where-clause
value2   $value2   An additional value to consider in the where-clause

[ Top ]

method postProcessExpandedObjectArrayCategories [line 1127]

The postProcessExpandedObjectArrayCategories( objArray &$objArray, rootCatID $rootCats, [includeRoot $includeRoot = false])

Post-process an object-array's expanded categories to generate relative paths



Tags:

return:  object-array with the additionally expanded category data is altered in place and returned


Parameters:

objArray   &$objArray   The object array we wish to post-process
rootCatID   $rootCats   The root category ID for the relative path creation
includeRoot   $includeRoot   whether or not to include the root folder in the relative path (optional) (default=false)

[ Top ]

method postProcessExpandedObjectCategories [line 1152]

The postProcessExpandedObjectCategories( obj &$obj, rootCat $rootCatsIDs, [includeRoot $includeRoot = false])

Post-process an object's expanded category data to generate relative paths



Tags:

return:  object with the additionally expanded category data is altered in place and returned


Parameters:

obj   &$obj   The object we wish to post-process
rootCat   $rootCatsIDs   The root category ID for the relative path creation
includeRoot   $includeRoot   whether or not to include the root folder in the relative path (optional) (default=false)

[ Top ]

method removeStandardFieldsFromObject [line 182]

Nothing, removeStandardFieldsFromObject( object The &$obj)

Remove the standard fields from the given object



Tags:

return:  object is altered in place


Parameters:

object The   &$obj   object to operate on

[ Top ]

method resequenceFields [line 324]

nothing resequenceFields( tablename $tablename, [field $field = 'position'], [float $float = false], [idcolumn $idcolumn = 'id'])

Fixes the sequence numbers (column position) in a given table.

Needed, if an object was added or deleted in a table using the arrow up/down feature.






Parameters:

tablename   $tablename   The tablename key for the PNTables structure
field   $field   The name of the field we wish to resequence (optional) (default='position')
float   $float   whether or not to use a float (optional) (default=false (uses integer))
idcolumn   $idcolumn   The column which contains the unique ID

[ Top ]

method retrieveObjectAttributes [line 432]

The retrieveObjectAttributes( object The $obj, type $type, [idcolumn $idcolumn = 'id'])

Retrieve the attribute maps for the specified object



Tags:

return:  object attribute (array)


Parameters:

object The   $obj   object whose attribute we wish to retrieve
type   $type   The type of the given object
idcolumn   $idcolumn   The column which holds the ID value (optional) (default='id')

[ Top ]

method retrieveObjectCategoriesList [line 928]

The retrieveObjectCategoriesList( obj $obj, tablename $tablename, [idcolumn $idcolumn = 'id'])

Retrieve object category data



Tags:

return:  object with the meta data filled in


Parameters:

obj   $obj   The object we wish to retrieve metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')

[ Top ]

method retrieveObjectCategoriesObjects [line 970]

The retrieveObjectCategoriesObjects( obj $obj, tablename $tablename, [idcolumn $idcolumn = 'id'], [assocKey $assocKey = ''], [ $enablePermissionCheck = true])

Retrieve object category data



Tags:

return:  object with the meta data filled in


Parameters:

obj   $obj   The object we wish to retrieve metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')
assocKey   $assocKey   The field to use for the associative array index (optional) (default='id')
   $enablePermissionCheck  

[ Top ]

method retrieveObjectMetaData [line 784]

The retrieveObjectMetaData( obj &$obj, tablename $tablename, [idcolumn $idcolumn = 'id'])

Retrieve object meta data



Tags:

return:  object with the meta data filled in


Parameters:

obj   &$obj   The object we wish to retrieve metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')

[ Top ]

method setStandardFieldsOnObjectCreate [line 120]

Nothing, setStandardFieldsOnObjectCreate( object The &$obj, [preserveValues $preserveValues = false], [idcolumn $idcolumn = 'id'])

Set the standard PN architecture fields for object creation/insert



Tags:

return:  object is altered in place


Parameters:

object The   &$obj   object we need to set the standard fields on
preserveValues   $preserveValues   whether or not to preserve value fields which have a valid value set (optional) (default=false)
idcolumn   $idcolumn   The column name of the primary key column (optional) (default='id')

[ Top ]

method setStandardFieldsOnObjectUpdate [line 154]

Nothing, setStandardFieldsOnObjectUpdate( object The &$obj, [preserveValues $preserveValues = false])

Set the standard PN architecture fields to sane values for an object update



Tags:

return:  object is altered in place


Parameters:

object The   &$obj   object we need to set the standard fields on
preserveValues   $preserveValues   whether or not to preserve value fields which have a valid value set (optional) (default=false)

[ Top ]

method storeObjectAttributes [line 494]

true/false storeObjectAttributes( object The $obj, type $type, [idcolumn $idcolumn = 'id'])

Store the attributes for the given objects.



Tags:

return:  on success/failure


Parameters:

object The   $obj   object whose attributes we wish to store
type   $type   The type of the given object
idcolumn   $idcolumn   The idcolumn of the object (optional) (default='id')

[ Top ]

method storeObjectCategories [line 839]

The storeObjectCategories( obj $obj, tablename $tablename, [idcolumn $idcolumn = 'id'])

Insert a categorization data object



Tags:

return:  result from the category data insert operation


Parameters:

obj   $obj   The object we wish to store categorization data for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')

[ Top ]

method updateObjectMetaData [line 720]

The updateObjectMetaData( obj &$obj, tablename $tablename, [idcolumn $idcolumn = 'id'])

Update a meta data object



Tags:

return:  result from the metadata insert operation


Parameters:

obj   &$obj   The object we wish to store metadata for
tablename   $tablename   The object's tablename
idcolumn   $idcolumn   The object's idcolumn (optional) (default='id')

[ Top ]

Packages:

Files:

Classes: