Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Static Public Member Functions | List of all members
AppHelper Class Reference

Static Public Member Functions

static getObjectIdFromContentId ($contentId=null)
static isContentId ($contentId=null)
static isNullOrEmptyString ($question=null)
static mysqlDate ($timestamp=null)
static footprint ($text)
static addParamsToUrl ($url, $params)
static removeParamsFromUrl ($url, $params)
static findItemsWithKey ($array, $searchKey, &$foundedItems)

Detailed Description

Gentics Portal.Node PHP Author & Copyright (c) by Gentics Software GmbH sales.nosp@m.@gen.nosp@m.tics..nosp@m.com http://www.gentics.com Licenses can be found in the LICENSE.txt file in the root-folder of this installation You must not use this software without a valid license agreement.

Helper class

Definition at line 12 of file AppHelper.php.

Member Function Documentation

static AppHelper::findItemsWithKey (   $array,
  $searchKey,
$foundedItems 
)
static

Helper function

Parameters
$array
$searchKey
$foundedItems

Definition at line 123 of file AppHelper.php.

{
foreach ($array as $key => $item) {
if ($key == $searchKey) {
$foundedItems[] = $item;
}
if (is_array($item)) {
self::findItemsWithKey($item, $searchKey, $foundedItems);
}
}
}
static AppHelper::getObjectIdFromContentId (   $contentId = null)
static

Gets the id of a given content id

Parameters
String$contentId
Returns
String ObjectId

Definition at line 21 of file AppHelper.php.

References isNullOrEmptyString().

Referenced by isContentId().

{
if (!is_string($contentId) || AppHelper::isNullOrEmptyString($contentId)) {
return false;
}
$pieces = explode(".", $contentId);
if (sizeof($pieces) != 2) {
return false;
}
return $pieces[1];
}
static AppHelper::isContentId (   $contentId = null)
static

checks if a given object is a content Id

Parameters
String$contentId
Returns
boolean

Definition at line 42 of file AppHelper.php.

References getObjectIdFromContentId().

{
return is_numeric(AppHelper::getObjectIdFromContentId($contentId));
}
static AppHelper::isNullOrEmptyString (   $question = null)
static

Checks if a string is null or empty

Parameters
string$question
Returns
boolean

Definition at line 52 of file AppHelper.php.

Referenced by ContentSourceModule\getBrowserCacheTimeByFileName(), and getObjectIdFromContentId().

{
return (!isset($question) || (trim($question) === ''));
}

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