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

Public Member Functions

 checkAccess ($userId, $contentPersonalisationAttributes)

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.

Definition at line 11 of file BasicPersonalisationRule.php.

Member Function Documentation

BasicPersonalisationRule::checkAccess (   $userId,
  $contentPersonalisationAttributes 
)

get list of personalization attributes for user and content check if they match

Parameters
int$userId
array$contentPersonalisationAttributes
Returns
bool if true they matched. false otherwise

Definition at line 22 of file BasicPersonalisationRule.php.

References PersonalisationAttribute\flatListForUser().

{
if (empty($contentPersonalisationAttributes)) {
return true;
}
$userPersonalisationAttributes = PersonalisationAttribute::flatListForUser($userId);
foreach ($contentPersonalisationAttributes as $cpa) {
if (in_array($cpa, $userPersonalisationAttributes)) {
return true;
}
}
return false;
}

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