Interface Inx_Api_Filter_FilterManager

Description

Often, mailings are to be sent not to the whole recipient list but only to a certain subgroup of recipients.

Often, mailings are to be sent not to the whole recipient list but only to a certain subgroup of recipients. Examples for such target groups are 'All recipients who read HTML format', 'Women', 'Men', 'People interested in product X', 'Recipients born after 1970', and so on. The Inx_Api_Filter_FilterManager can be used to create and retrieve

  1. Filter
s (target groups). The following snippet creates a global Inx_Api_Filter_Filter:
 $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
 $oFilterManager = $oSession->getFilterManager();
 $oFilter = $oFilterManager->createFilter( $oSystemListContext );

 $oFilter->updateName( "New Yorker" );
 $oFilter->updateStatement( "city LIKE \"New York\"" );
 $oFilter->commitUpdate();

An Inx_Api_Filter_Filter can be assigned to an individual Inx_Api_Mailing_Mailing, as demonstrated in the following snippet:

    $oMailing = ...

    $oMailing->updateFilterId( $oFilter->getId() );
    $oMailing->commitUpdate();

The retrieval of Inx_Api_Filter_Filters can be accomplished using the selectAll() method to retrieve all filters, or one of the methods that expect an Inx_Api_List_ListContext to retrieve only the filters assigned to a specific list. The following snippet shows how to retrieve all filters belonging to the specified list, ordered by their creation date:

 $oListContext = $oSession->getListContextManager()->findByName( "Desired list" );
 $oFilterManager = $oSession->getFilterManager();

 $oBOResultSet = $oFilterManager->select( $oListContext,
 	Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME, Inx_Api_Order::ASC );

 for( $i = 0; $i < $oBOResultSet->size(); $i++ )
 {
 	$oFilter = $oBOResultSet->get( $i );
 	echo $oFilter->getName()."<br>";
 }

 $oBOResultSet->close();

Note: The usage of Inx_Api_Filter_Filters requires the api user right: Inx_Api_UserRights::FILTER_FEATURE_USE

For more information on filters and the filter statement syntax, see the Inx_Api_Filter_Filter documentation.

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

Located in /Api/Filter/FilterManager.php (line 65)

Inx_Api_BOManager
   |
   --Inx_Api_Filter_FilterManager
Method Summary
an select (Inx_Api_List_ListContext $oListContext, [int $iOrderAttribute = null], [int $orderType = null])
Methods
createFilter (line 79)

Creates a new filter that belongs to the specified list.

Creates a new filter that belongs to the specified list. To create a global filter, use the system list. The following snippet shows how to retrieve the Inx_Api_List_SystemListContext:

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

  • return: a new filter.
  • access: public
Inx_Api_Filter_Filter createFilter (Inx_Api_List_ListContext $oListContext)
select (line 94)

Returns an Inx_Api_BOResultSet containing all filters which belong to the specified list ordered by the specified order attribute and type.

Returns an Inx_Api_BOResultSet containing all filters which belong to the specified list ordered by the specified order attribute and type. To retrieve the global filters, use the system list.

  • return: Inx_Api_BOResultSet that contains the data produced by the given query.
  • throws: Inx_Api_SecurityException if the session user doesn't have the following permission: Inx_Api_UserRights::FILTER_FEATURE_USE
  • access: public
an select (Inx_Api_List_ListContext $oListContext, [int $iOrderAttribute = null], [int $orderType = null])
  • Inx_Api_List_ListContext $oListContext: all filters belonging to this list will be retrieved.
  • int $iOrderAttribute: the order attribute (Inx_Api_Filter_Filter::ATTRIBUTE_NAME or Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME). May be ommitted.
  • int $orderType: the order type (Inx_Api_Order::ASC or Inx_Api_Order::DESC). 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:24 +0200 by phpDocumentor 1.3.2