Documentation

GetInstance

object
CTaskFilterCtrl::getInstance(
	$userId,
	$bGroupMode = false
);

This method returns CTaskFilterCtrl class instance.

Note: Accepts an array of configuration parameters and generates scripts, necessary yo show file dialog. Static method.

Method parameters

Parameter Description Available from version
$userIdID of the user, on behalf of which the work is performed (option of impersonation).
$bGroupModeFlag "group mode". When this mode is enabled (true), other set of preset filters is returned.
By default — false.

Returned value

CTaskFilterCtrl class object is returned. The same object will be returned when repeatedly calling the method with parameters that were previously already passed.

Examples of use

<?php
CModule::IncludeModule('tasks');
$userId = (int) $GLOBALS['USER']->getId();
$bGroupMode = false;
$oFilter1 = CTaskFilterCtrl::getInstance($userId, $bGroupMode);
$bGroupMode = true;
$oFilter2 = CTaskFilterCtrl::getInstance($userId, $bGroupMode);
$oFilter3 = CTaskFilterCtrl::getInstance($userId, $bGroupMode);


var_dump ($oFilter1 === $oFilter2);	// shows false
// shows true, because the same object is linked in both variables
var_dump ($oFilter2 === $oFilter3);
?>


© «Bitrix24», 2001-2024