Interface Inx_Api_Action_ActionManager

Description

The Inx_Api_Action_ActionManager manages all actions.

The Inx_Api_Action_ActionManager manages all actions. The following snippet creates a new Action that sets the lastClick recipient attribute (last time the recipient clicked a link) to the current date and increments the clickCount recipient attribute (the number of clicks by the recipient):

 $oListContextManager = $oSession->getListContextManager();
 $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );

 $oRecipientMetaData = $session->createRecipientContext()->getMetaData();
 $iLastClick = $oRecipientMetaData->getUserAttribute( "lastClick" )->getId();
 $iClickCount = $oRecipientMetaData->getUserAttribute( "clickCount" )->getId();

 $oActionMgr = $oSession->getActionManager();

 $oAction = $oActionMgr->createAction( $oListContext );
 $oAction->updateEventType( Inx_Api_Action_Action::EVENT_TYPE_CLICK );
 $oAction->updateName( "Click-Registry" );

 $oCommandFactory = $oActionMgr->getCommandFactory();

 $aCmds = array();
 $aCmds[] = $oCommandFactory->createSetValueCmd( $iLastClick, "=Date()" );
 $aCmds[] = $oCommandFactory->createSetRelativeValueCmd( $iClickCount, 1 );

 $oAction->updateCommands( $aCmds );
 $oAction->commitUpdate();
Note: The recipient attributes referenced in the snippet are not standard attributes and must be created using the Inx_Api_Recipient_AttributeManager before they may be used in the shown way.

Note: The usage of Inx_Api_Action_Actions requires the api user right: Inx_Api_UserRights::ACTION_FEATURE_USE

For more information on actions (including event types), see the Inx_Api_Action_Action documentation.

  • version: $Revision: 9482 $ $Date: 2007-12-18 16:42:11 +0200 (An, 18 Grd 2007) $ $Author: vladas $
  • see: Inx_Api_Action_Action
  • since: API 1.2.0

Located in /Api/Action/ActionManager.php (line 50)

Inx_Api_BOManager
   |
   --Inx_Api_Action_ActionManager
Method Summary
Methods
createAction (line 67)

Creates a new, empty action with the specified owning list.

Creates a new, empty action with the specified owning list. If the action is not list specific, the system list context must be used. The following snippet retrieves the system list context:

 $oListContextManager = $oSession->getListContextManager();
 $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );

  • return: a new action.
  • access: public
Inx_Api_Action_Action createAction (Inx_Api_List_ListContext $oListContext)
getCommandFactory (line 95)

Returns the factory used to create new commands.

Returns the factory used to create new commands. Inx_Api_Action_Commands are executed by an Inx_Api_Action if the event associated with that action is triggered.

  • return: the command factory.
  • access: public
Inx_Api_Action_CommandFactory getCommandFactory ()
select (line 85)

Selects all actions owned by the specified list context.

Selects all actions owned by the specified list context. To retrieve actions which are not list specific, use the system list context. The following snippet retrieves the system list context:

 $oListContextManager = $oSession->getListContextManager();
 $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME );

  • return: an Inx_Api_BOResultSet object that contains the actions owned by the specified list.
  • throws: Inx_Api_SecurityException if the session user doesn't have the following permission: Inx_Api_UserRights::ACTION_FEATURE_USE
  • access: public
Inx_Api_BOResultSet select ( $mListContext)
  • $mListContext

Inherited Methods

Inherited From Inx_Api_BOManager

Inx_Api_BOManager::get()
Inx_Api_BOManager::remove()
Inx_Api_BOManager::selectAll()

Documentation generated on Thu, 17 Sep 2015 14:27:20 +0200 by phpDocumentor 1.3.2