Interface Inx_Api_TextModule_TextModuleManager

Description

The Inx_Api_TextModule_TextModuleManager can be used to retrieve and create text modules.

The Inx_Api_TextModule_TextModuleManager can be used to retrieve and create text modules. Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the text module is defined in the system list). A common text module is a custom, personalized salutation. The following snippet shows how to create a new text module and update its name:

 $oTextmoduleManager = $oSession->getTextmoduleManager();
 $oListContext = $oSession->getListContextManager()->findByName( "Desired List" );
 $oTextModule = $oTextmoduleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT );

 $oTextModule->updateName( "Desired name" );
 $oTextModule->commitUpdate();

To retrieve existing text modules, use one of the two select methods provided by this manager. The following snippet shows how to retrieve all global text modules, ordered by their name, and prints out some information regarding these text modules:

 $oTextmoduleManager = $oSession->getTextmoduleManager();
 $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
 $oBOResultSet = $oTextmoduleManager->select( $oListContext, Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME, Inx_Api_Order::DESC );

 for( $i = 0; $i < $oBOResultSet->size(); $i++ )
 {
 	$oTextModule = $oBOResultSet->get( $i );
 	echo "Textmodule ".$oTextModule->getName()." has the content type ".$oTextModule->getMimeType()."<br>";
 }

 $oBOResultSet->close();
For more information on text modules, see the Inx_Api_TextModule_TextModule documentation.

  • version: $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
  • see: Inx_Api_TextModule_TextModule
  • since: API 1.4.0

Located in /Api/TextModule/TextModuleManager.php (line 51)

Inx_Api_BOManager
   |
   --Inx_Api_TextModule_TextModuleManager
Method Summary
a createTextmodule (Inx_Api_List_ListContext $oListContext, int $iMimeType)
Inx_Api_BOResultSet select (Inx_Api_List_ListContext $oListContext, [int $iOrderAttribute = null], [int $iOrderType = null])
Methods
createTextmodule (line 72)

Creates a new text module in the specified list.

Creates a new text module in the specified list. To create a globally available text module, use the SystemListContext. The SystemListContext can be retrieved using the following snippet:

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

  • return: new text module.
  • access: public
a createTextmodule (Inx_Api_List_ListContext $oListContext, int $iMimeType)
  • Inx_Api_List_ListContext $oListContext: the list the text module shall be created for.
  • int $iMimeType: the MIME type of this text module. May be one of:
    • Inx_Api_TextModule_TextModule::MIME_TYPE_HTML_TEXT,
    • Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT or
    • Inx_Api_TextModule_TextModule::MIME_TYPE_MULTIPART
select (line 87)

Returns an Inx_Api_BOResultSet containing all text modules in the specified list, ordered by the given attribute.

Returns an Inx_Api_BOResultSet containing all text modules in the specified list, ordered by the given attribute.

  • return: an Inx_Api_BOResultSet containing all text modules in the specified list.
  • throws: Inx_Api_SecurityException if the session user doesn't have the following permission: Inx_Api_UserRights::TEXTMODULE_FEATURE_USE
  • access: public
Inx_Api_BOResultSet select (Inx_Api_List_ListContext $oListContext, [int $iOrderAttribute = null], [int $iOrderType = null])
  • Inx_Api_List_ListContext $oListContext: all text modules of this list will be selected.
  • int $iOrderAttribute: the order attribute (only Inx_Api_TextModule_TextModule::ATTRIBUTE_NAME). May be ommitted.
  • int $iOrderType: the order type (Inx_Api_Order::ASC or Inx_Api_Order::DES). May be ommitted.

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:32 +0200 by phpDocumentor 1.3.2