<commit_before><?php
/**
 * @package plugins.businessProcessNotification
 * @subpackage admin
 */
class Kaltura_View_Helper_EntryBusinessProcess extends Kaltura_View_Helper_PartialViewPlugin
{
	private $entryId;
	private $partnerId;
	
	/* (non-PHPdoc)
	 * @see Kaltura_View_Helper_PartialViewPlugin::plug()
	 */
	public function plug(Zend_View_Interface $view)
	{
		$entry = $view->investigateData->entry;
		$this->entryId = $entry->id;
		$this->partnerId = $entry->partnerId;
		parent::plug($view);
	}
	
	/* (non-PHPdoc)
	 * @see Kaltura_View_Helper_PartialViewPlugin::getDataArray()
	 */
	protected function getDataArray()
	{
		$client = Infra_ClientHelper::getClient();
		$eventNotificationPlugin = Kaltura_Client_EventNotification_Plugin::get($client);
		$businessProcessNotificationPlugin = Kaltura_Client_BusinessProcessNotification_Plugin::get($client);
		
		$errDescriptions = array();
		$businessProcessCases = array();
		try
		{
			Infra_ClientHelper::impersonate($this->partnerId);
			$objectType = Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::ENTRY;
			$businessProcessCases = $businessProcessNotificationPlugin->businessProcessCase->listAction($objectType, $this->entryId);
			Infra_ClientHelper::unimpersonate();
		}
		catch (Exception $e)
		{
			$errDescriptions[] = $e->getMessage();
		}
	
		$templateIds = array();
		$businessProcesses = array();
		$businessProcessCasesUrls = array();
		if(count($businessProcessCases))
		{
			foreach($businessProcessCases as $businessProcessCase)
			{
				$businessProcessCasesUrls[$businessProcessCase->templateId] = $businessProcessNotificationPlugin->businessProcessCase->serveDiagram($objectType, $this->entryId, $businessProcessCase->templateId);
				$businessProcesses[$businessProcessCase->templateId] = $businessProcessCase;
				$templateIds[] = $businessProcessCase->templateId;
			}
		}

		$eventNotificationTemplates = array();
		if(count($templateIds))
		{
			$filter = new Kaltura_Client_EventNotification_Type_EventNotificationTemplateFilter();
			$filter->idIn = implode(',', $templateIds);
			try
			{
				Infra_ClientHelper::impersonate($this->partnerId);
				$eventNotificationTemplateList = $eventNotificationPlugin->eventNotificationTemplate->listAction($filter);<commit_msg>Fixed property name<commit_after><?php
/**
 * @package plugins.businessProcessNotification
 * @subpackage admin
 */
class Kaltura_View_Helper_EntryBusinessProcess extends Kaltura_View_Helper_PartialViewPlugin
{
	private $entryId;
	private $partnerId;
	
	/* (non-PHPdoc)
	 * @see Kaltura_View_Helper_PartialViewPlugin::plug()
	 */
	public function plug(Zend_View_Interface $view)
	{
		$entry = $view->investigateData->entry;
		$this->entryId = $entry->id;
		$this->partnerId = $entry->partnerId;
		parent::plug($view);
	}
	
	/* (non-PHPdoc)
	 * @see Kaltura_View_Helper_PartialViewPlugin::getDataArray()
	 */
	protected function getDataArray()
	{
		$client = Infra_ClientHelper::getClient();
		$eventNotificationPlugin = Kaltura_Client_EventNotification_Plugin::get($client);
		$businessProcessNotificationPlugin = Kaltura_Client_BusinessProcessNotification_Plugin::get($client);
		
		$errDescriptions = array();
		$businessProcessCases = array();
		try
		{
			Infra_ClientHelper::impersonate($this->partnerId);
			$objectType = Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::ENTRY;
			$businessProcessCases = $businessProcessNotificationPlugin->businessProcessCase->listAction($objectType, $this->entryId);
			Infra_ClientHelper::unimpersonate();
		}
		catch (Exception $e)
		{
			$errDescriptions[] = $e->getMessage();
		}
	
		$templateIds = array();
		$businessProcesses = array();
		$businessProcessCasesUrls = array();
		if(count($businessProcessCases))
		{
			foreach($businessProcessCases as $businessProcessCase)
			{
				$businessProcessCasesUrls[$businessProcessCase->businessProcessStartNotificationTemplateId] = $businessProcessNotificationPlugin->businessProcessCase->serveDiagram($objectType, $this->entryId, $businessProcessCase->businessProcessStartNotificationTemplateId);
				$businessProcesses[$businessProcessCase->businessProcessStartNotificationTemplateId] = $businessProcessCase;
				$templateIds[] = $businessProcessCase->businessProcessStartNotificationTemplateId;
			}
		}

		$eventNotificationTemplates = array();
		if(count($templateIds))
		{
			$filter = new Kaltura_Client_EventNotification_Type_EventNotificationTemplateFilter();
			$filter->idIn = implode(',', $templateIds);
			try
			{
				Infra_ClientHelper::impersonate($this->partnerId);
				$eventNotificationTemplateList = $eventNotificationPlugin->eventNotificationTemplate->listAction($filter);
{'fraction_non_alphanumeric': 0.12126387702818105, 'fraction_numerical': 0.0, 'mean_word_length': 6.873949579831932, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5453132', 'n_tokens_mistral': 1519, 'n_tokens_neox': 1366, 'n_words': 175}