getData
array public function getData( $isReturnEscapedData = true );
This method returns an array, containing data for the task (TITLE, DESCRIPTION and etc.).
Method parameters
Parameter | Description |
---|---|
$isReturnEscapedData | If true (by default), then escape data is returned; original ("raw") data will have key with swung dash (~TITLE , ~DESCRIPTION and etc). |
Examples
Creating an entity instance.
$task = new \Bitrix\Tasks\Item\Task(100); // getting entity with selected id $task = new \Bitrix\Tasks\Item\Task(100, 1); // getting entity with selected id and with user 1
$task->getData();
get all data for the task. $task->getData(array('~'));
get only main data. Cached data will be included into this selection as well. For example, in one case we have requested the main data, and in the second case we requested an additional field in the same task. Then if in a third time, we are to call ~, then the additional field is also going to be in this selection. $task->getData(array('#'));
get all fields that are available in the database$task->getData(array('UF_#'));
get all user fieldsFirst parameter doesn't necessarily have to be an array, it can be a string as well:
$task->getData('FIELD_NAME');
Also we can request $task as the array:
$task['TITLE']
- it will complete all the required requests by itself
© «Bitrix24», 2001-2024