You are here

function KalturaNotificationClient::splitMultiNotifications in Kaltura 5

Same name and namespace in other branches
  1. 6.2 kaltura_client/kaltura_notification_client.php \KalturaNotificationClient::splitMultiNotifications()
  2. 6 kaltura_client/kaltura_notification_client.php \KalturaNotificationClient::splitMultiNotifications()
  3. 7.3 kaltura_client/kaltura_notification_client.php \KalturaNotificationClient::splitMultiNotifications()
  4. 7.2 kaltura_client/kaltura_notification_client.php \KalturaNotificationClient::splitMultiNotifications()
1 call to KalturaNotificationClient::splitMultiNotifications()
KalturaNotificationClient::KalturaNotificationClient in kaltura_client/kaltura_notification_client.php

File

kaltura_client/kaltura_notification_client.php, line 47

Class

KalturaNotificationClient

Code

function splitMultiNotifications($data) {
  $not_data = array();
  foreach ($data as $name => $value) {
    $match = preg_match("/^(not[^_]*)_(.*)\$/", $name, $parts);
    if (!$match) {
      continue;
    }
    $not_name_parts = $parts[1];
    $not_property = @$parts[2];
    $num = (int) str_replace('not', '', $not_name_parts);
    $not_data[$num][$not_property] = $value;
  }
  return $not_data;
}