Emma PHP: updateSearch()

Update a search definition in Emma.

Arguments: 

  • int $search_id - The ID for the search you want to update.
  • array $criteria - The criteria that define the search. (See createSearch() for details.)
  • string $search_name - The updated name for your search.

Both $criteria and $search_name are optional, but you need to supply at least one of them to update. If you do not wish to update the search criteria, pass null as the argument.

Use:


require_once('../../MyEmmaPHP.php');

try {

	$me = new MyEmmaPHP();
   
	$search_id = 19200;
	
	$name = 'PeopleSoft Members with Weekly Email Pref';
	
	$criteria = 
	  array(
		"and",
		array(	
			"or",
			array("group", "in", "General: Marketing Contacts Only - PeopleSoft"),
			array("group", "in", "SIG: PeopleSoft Compensation & Benefits"),
			array("group", "in", "Product: PeopleSoft"),
			array("group", "in", "Interest: Absence Management")
		),
		array(	
			"or",
			array("member_field:wildcard_1355694", "undefined"),
			array("member_field:wildcard_1355694", "contains", "Weekly"),
			array("member_field:wildcard_1355694", "contains", "Not Specified")
		)
	  );

    $retval = $me->updateSearch($search_id, $criteria, $name);
    
	if ($retval) {
		echo "Search updated successfully.\n";
	} else {
		echo "Search not updated.\n";
	}
        
    
} catch ( Exception $e ) {
    echo $e->getMessage() . "\n\n";
}



Wrapper for: update_search

Keep in Touch

Contact Us

Buzz

Loading...

People talking about '@synergycode':