A collection of core helper methods.
- printTable
- getListOfAliases
- expandAliases
- fastRelatedObjectCount
- displayNodeList
- displayNonObjectList
- displayObjectList
- extractAdditionalParams
- republishObject
- convertTimeToInteger
- fixXML
- fixBadQuestionMarks
Outputs data in a formatted ASCII table
Parameters:
$table
table data, with the first row listing the column headers; Array$description
an optional table description; String
$table = array
(
[0] => array
(
'OID'
, 'NID'
, 'Title'
),
[1] => array
(
12345
, 12346
, 'Lorem Ipsum'
)
// etc ...
);
eep::printTable( $table, "A dummy description" );
+--------+---------+--------------+
I A dummy description |
+--------+---------+--------------+
I OID | NID | Title |
+--------+---------+--------------+
| 12345 | 12346 | Lorem Ipsum |
...
Returns an array of all module aliases
Returns the expanded version of the module name, e.g. cc => contentclass
Parameters:
$alias
the alias to expand; String
Returns:
- The expanded alias or the original
$alias
value if the alias is not found; String
Returns the (reverse)related object count for a given content object id.
Parameters:
$objectId
Integer$objectVersion
Integer$attributeID
Integer; Optional; Default = 0$reverseRelatedObjects
Boolean; Optional; Default = false$params
Boolean; Optional; Default = false
Returns:
- Integer
Outputs an formatted ASCII table of node information, from a list of nodes.
Parameters:
$list
Array of eZContentObjectTreeNode(s)$title
String
Outputs an formatted ASCII table of node information, from a list of 'non-objects'.
Note:
A non-object is the array of data that you get when you fetch an object but say that you don't actually want the object.
Parameters:
$list
Array of eZContentObjectTreeNode(s)$title
String
Outputs an formatted ASCII table of node information, from a list of content objects.
$list
Array of eZContentObject(s)$title
String
Returns key value pairs based on any params to the command line that match: --key=value
Parameters:
&$args
Array
Re-publishes a content object.
Note:
This protects against accidentally operating on an object with no main node, i.e. an object that is in the trash
Parameters:
$objectId
Integer
Converts time string to number of seconds.
Parameters:
$time
String; hh:mm:ss
Returns:
- Integer
Cleans many common forms of XML corruption, and ultimately forces character encoding.
Note:
This method can render some remaining characters as question marks, but many of those can be fixed too, see fixBadQuestionMarks.
Parameters:
$xml
XML String
Returns:
- XML String
Fixes 'bad' question marks that have been been introduced by forcing the encoding to utf8 (e.g. via fixXML).
Parameters:
$xml
XML String
Returns:
- XML String