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

Public Member Functions

 run ($limit=null)
 getFiltersList ()
 loadMaxUpdatetimestamp ()

Public Attributes

 $folderIds
 $lang
 $data = array()
 $tags = array()
 $usePersonalisation = true
 $htmlCacheKey = ''
 $overviewPage
 $tagstyles = array()
 $tagsSeparator = ', '

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.

Class for working with Gentics Content Connector

Definition at line 12 of file TagcloudApi.php.

Member Function Documentation

TagcloudApi::getFiltersList ( )

Filter tree by some schema

Returns
array|bool

Definition at line 213 of file TagcloudApi.php.

{
if (Yii::app()->getModule('contentSource')->contentSource->usePersonalisation) {
$filters = Yii::app()->getModule('contentSource')->contentSource->personalisationFields;
return $filters;
}
return false;
}
TagcloudApi::loadMaxUpdatetimestamp ( )

extracts max updatetimestamp from array of CMS objects

Returns
int|bool

Definition at line 270 of file TagcloudApi.php.

{
// TODO cachekey is wrong - should only be cached for $cacheTime
$timestampCacheId = 'tagcloud_UTS_'.md5(implode(',', $this->folderIds).$this->lang);
//try to get $maxTimestamp from cache
if (($maxTimestamp = Yii::app()->cache->get($timestampCacheId)) === false) {
$timestamps = Yii::app()->repositoryApi->request(
array(
'filter' => 'object.contentid=="'.implode('" OR object.contentid=="', $this->folderIds).'"',
'type' => 'php',
'sorting' => 'updatetimestamp:desc',
'count' => '1'
),
array('updatetimestamp')
);
$timestamps = unserialize($timestamps);
if (isset($timestamps['status']) && $timestamps['status']=='ok') {
unset($timestamps['status']);
$maxTimestamp = 0;
foreach ($timestamps as $id=>$contentFolder) {
if (isset($contentFolder['attributes']['updatetimestamp']) && $contentFolder['attributes']['updatetimestamp'] > $maxTimestamp) {
$maxTimestamp = $contentFolder['attributes']['updatetimestamp'];
}
}
Yii::app()->cache->set($timestampCacheId, $maxTimestamp, Yii::app()->getModule('tagcloud')->cacheTime);
} else {
$maxTimestamp = false;
}
}
return $maxTimestamp;
}
TagcloudApi::run (   $limit = null)

Performs GCC request, filters data by personalisation rules and extacts tags from received data

Returns
void|bool

Definition at line 68 of file TagcloudApi.php.

{
//Yii::app()->cache->flush();
if (!empty($this->folderIds)) {
sort($this->folderIds);
$this->_loadData();
$this->_cleanUp(Yii::app()->user->id);
$this->_extractTags($limit);
return true;
} else {
return false;
}
}

Member Data Documentation

TagcloudApi::$data = array()

array that contains received data

Definition at line 29 of file TagcloudApi.php.

TagcloudApi::$tags = array()

array that contains extracted tags

Definition at line 36 of file TagcloudApi.php.


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