Bitrix API

ReturnGraph extends BaseGraph

Class Deal

Table of Contents

Constants

DATE_INDEX_FORMAT  = "Y-m-d"
DAY_DIVISION  = 'DAY_DIVISION'
DAY_MONTH_DIVISION  = 'DAY_MONTH_DIVISION'
DEFAULT_AVATAR_HEIGHT  = 42
DEFAULT_AVATAR_WIDTH  = 42
FILTER_FIELDS_PREFIX  = 'FROM_DEAL_'
GROUP_DAY  = 1
GROUP_MONTH  = 2
GROUP_WEEK_DAY  = 3
GROUPING_BY_DATE  = 'DATE'
GROUPING_BY_RESPONSIBLE  = 'RESPONSIBLE'
GROUPING_BY_SOURCE  = 'SOURCE'
GROUPING_BY_STAGE  = 'STAGE'
MONTH_DIVISION  = 'MONTH_DIVISION'
QUARTER_MONTH_DIVISION  = 'MONTH_DIVISION'
SHIFTED_MONTH_DIVISION  = 'SHIFTED_MONTH_DIVISION'
STAGE_DEFAULT_COLORS  = ['DEFAULT_COLOR' => '#ACE9FB', 'DEFAULT_FINAL_SUCCESS__COLOR' => '#DBF199', 'DEFAULT_FINAL_UN_SUCCESS_COLOR' => '#FFBEBD', 'DEFAULT_LINE_COLOR' => '#ACE9FB']
STEP_DAY  = "1d"
STEP_MONTH  = "1m"
WEEK_DAY_DIVISION  = 'WEEK_DAY_DIVISION'
WHAT_WILL_CALCULATE_DEAL_CONVERSION  = 'DEAL_CONVERSION'
WHAT_WILL_CALCULATE_DEAL_COUNT  = 'DEAL_COUNT'
WHAT_WILL_CALCULATE_DEAL_DATA_FOR_FUNNEL  = 'DEAL_DATA_FOR_FUNNEL'
WHAT_WILL_CALCULATE_DEAL_LOSES_COUNT  = 'DEAL_LOSES_COUNT'
WHAT_WILL_CALCULATE_DEAL_LOSES_SUM  = 'DEAL_LOSES_SUM'
WHAT_WILL_CALCULATE_DEAL_SUM  = 'DEAL_SUM'
WHAT_WILL_CALCULATE_DEAL_WON_COUNT  = 'DEAL_WON_COUNT'
WHAT_WILL_CALCULATE_DEAL_WON_SUM  = 'DEAL_WON_SUM'
WHAT_WILL_CALCULATE_RETURN_DEAL_WON_SUM  = 'RETURN_DEAL_WON_SUM'
WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL  = 'SUCCESS_DEAL_DATA_FOR_FUNNEL'

Methods

__clone()  : void
In cloning of entity clone nested entities too.(configurations, form elements list).
__construct()  : mixed
BaseReport constructor.
addFormElement()  : void
Add form element to end of elements list.
addFormElementAfter()  : void
Add form element after target element.
addFormElementBefore()  : void
Add form element before target element.
addFormElementToEnd()  : void
Analog of add form element.
addFormElementToStart()  : void
Insert element to start of form elements list.
fillDateGaps()  : mixed
fillReport()  : void
Fill report handler properties from Report entity.
getAnalyticBoardByKey()  : AnalyticBoard
getCalculatedData()  : mixed
Fix base method - return array only
getCalculateField()  : DropDown
getCategoryKey()  : string
getClassName()  : string
getCollectedFormElements()  : array<string|int, Base>
getConfiguration()  : Configuration|null
TODO@ optimise this
getConfigurations()  : array<string|int, Configuration>
getConfigurationsGidKeyed()  : array<string|int, Configuration>
getDatesRange()  : Generator<string|int, Date>
Returns range of dates starting with from date and ending with to date.
getFormElement()  : Base|BaseValuable|null
In form elements list find form element with key $fieldKey.
getFormElementByDataAttribute()  : Base|null
Find form element by attribute key value pair.
getFormElementFromCollected()  : Base|BaseValuable|null
getFormElements()  : array<string|int, Base>
getFormElementValue()  : mixed|null
Returns value of the form element with given key.
getGroupByOptions()  : array<string|int, mixed>
getGroupingField()  : DropDown
getMultipleData()  : array<string|int, mixed>
array with format array( 'items' => array( array( 'label' => 'Some Title', 'value' => 5, 'targetUrl' => 'http://url.domain?params=param' ) ) )
getMultipleDemoData()  : array<string|int, mixed>
getMultipleGroupedData()  : array<string|int, mixed>
Array format for return this method:<br> array( 'items' => array( array( 'groupBy' => 01.01.1970 or 15 etc.
getMultipleGroupedDemoData()  : array<string|int, mixed>
getPreviousPeriod()  : mixed
getReport()  : Report
getReportImplementedDataTypes()  : array<string|int, mixed>
getSingleData()  : array<string|int, mixed>
array with format array( 'title' => 'Some Title', 'value' => 0, 'targetUrl' => 'http://url.domain?params=param' )
getSingleDemoData()  : array<string|int, mixed>
getTargetUrl()  : mixed
getTitle()  : string
getUnitKey()  : string
getUserInfo()  : array<string|int, mixed>|null
Returns [id, name, link, icon] for the specified use id.
getView()  : View|null
getWeight()  : mixed
getWhatWillCalculateOptions()  : array<string|int, mixed>
getWidgetHandler()  : BaseWidget|null
isEnabled()  : bool
In some case, need to dynamically disable some report handler
mutateFilterParameter()  : array<string|int, mixed>
padNormalizedData()  : mixed
preloadUserInfo()  : mixed
prepare()  : mixed
Called every time when calculate some report result before passing some concrete handler, such us getMultipleData or getSingleData.
prepareEntityListFilter()  : mixed
prepareQuery()  : mixed
removeFormElement()  : bool
Remove from form elements list form element.
setCalculatedData()  : void
setConfigurations()  : void
setFormElements()  : void
Setter to set form elements multiply.
setReport()  : void
setTitle()  : void
setView()  : void
setWeight()  : void
setWidgetHandler()  : void
Attach report handler to widget handler.
updateFormElementValue()  : bool

Constants

DATE_INDEX_FORMAT

public mixed DATE_INDEX_FORMAT = "Y-m-d"

DAY_DIVISION

public mixed DAY_DIVISION = 'DAY_DIVISION'

DAY_MONTH_DIVISION

public mixed DAY_MONTH_DIVISION = 'DAY_MONTH_DIVISION'

DEFAULT_AVATAR_HEIGHT

public mixed DEFAULT_AVATAR_HEIGHT = 42

DEFAULT_AVATAR_WIDTH

public mixed DEFAULT_AVATAR_WIDTH = 42

FILTER_FIELDS_PREFIX

public mixed FILTER_FIELDS_PREFIX = 'FROM_DEAL_'

GROUP_WEEK_DAY

public mixed GROUP_WEEK_DAY = 3

GROUPING_BY_DATE

public mixed GROUPING_BY_DATE = 'DATE'

GROUPING_BY_RESPONSIBLE

public mixed GROUPING_BY_RESPONSIBLE = 'RESPONSIBLE'

GROUPING_BY_SOURCE

public mixed GROUPING_BY_SOURCE = 'SOURCE'

GROUPING_BY_STAGE

public mixed GROUPING_BY_STAGE = 'STAGE'

MONTH_DIVISION

public mixed MONTH_DIVISION = 'MONTH_DIVISION'

QUARTER_MONTH_DIVISION

public mixed QUARTER_MONTH_DIVISION = 'MONTH_DIVISION'

SHIFTED_MONTH_DIVISION

public mixed SHIFTED_MONTH_DIVISION = 'SHIFTED_MONTH_DIVISION'

STAGE_DEFAULT_COLORS

public mixed STAGE_DEFAULT_COLORS = ['DEFAULT_COLOR' => '#ACE9FB', 'DEFAULT_FINAL_SUCCESS__COLOR' => '#DBF199', 'DEFAULT_FINAL_UN_SUCCESS_COLOR' => '#FFBEBD', 'DEFAULT_LINE_COLOR' => '#ACE9FB']

WEEK_DAY_DIVISION

public mixed WEEK_DAY_DIVISION = 'WEEK_DAY_DIVISION'

WHAT_WILL_CALCULATE_DEAL_CONVERSION

public mixed WHAT_WILL_CALCULATE_DEAL_CONVERSION = 'DEAL_CONVERSION'

WHAT_WILL_CALCULATE_DEAL_COUNT

public mixed WHAT_WILL_CALCULATE_DEAL_COUNT = 'DEAL_COUNT'

WHAT_WILL_CALCULATE_DEAL_DATA_FOR_FUNNEL

public mixed WHAT_WILL_CALCULATE_DEAL_DATA_FOR_FUNNEL = 'DEAL_DATA_FOR_FUNNEL'

WHAT_WILL_CALCULATE_DEAL_LOSES_COUNT

public mixed WHAT_WILL_CALCULATE_DEAL_LOSES_COUNT = 'DEAL_LOSES_COUNT'

WHAT_WILL_CALCULATE_DEAL_LOSES_SUM

public mixed WHAT_WILL_CALCULATE_DEAL_LOSES_SUM = 'DEAL_LOSES_SUM'

WHAT_WILL_CALCULATE_DEAL_SUM

public mixed WHAT_WILL_CALCULATE_DEAL_SUM = 'DEAL_SUM'

WHAT_WILL_CALCULATE_DEAL_WON_COUNT

public mixed WHAT_WILL_CALCULATE_DEAL_WON_COUNT = 'DEAL_WON_COUNT'

WHAT_WILL_CALCULATE_DEAL_WON_SUM

public mixed WHAT_WILL_CALCULATE_DEAL_WON_SUM = 'DEAL_WON_SUM'

WHAT_WILL_CALCULATE_RETURN_DEAL_WON_SUM

public mixed WHAT_WILL_CALCULATE_RETURN_DEAL_WON_SUM = 'RETURN_DEAL_WON_SUM'

WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL

public mixed WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL = 'SUCCESS_DEAL_DATA_FOR_FUNNEL'

Methods

__clone()

In cloning of entity clone nested entities too.(configurations, form elements list).

public __clone() : void

__construct()

BaseReport constructor.

public __construct() : mixed

addFormElement()

Add form element to end of elements list.

public addFormElement(Base $element) : void
Parameters
$element : Base

Element to add to form.

addFormElementAfter()

Add form element after target element.

public addFormElementAfter(Base $newElement, Base $targetElement) : void
Parameters
$newElement : Base

Element to add to form.

$targetElement : Base

Element after which need to add.

addFormElementBefore()

Add form element before target element.

public addFormElementBefore(Base $newElement, Base $targetElement) : void
Parameters
$newElement : Base

Element to add to form.

$targetElement : Base

Element before which need to add.

addFormElementToEnd()

Analog of add form element.

public addFormElementToEnd(Base $newElement) : void
Parameters
$newElement : Base

Element which need to insert to end of form.

addFormElementToStart()

Insert element to start of form elements list.

public addFormElementToStart(Base $newElement) : void
Parameters
$newElement : Base

Element which need to insert to start of form.

fillDateGaps()

public fillDateGaps(mixed &$normalizedData, Date $dateFrom, Date $dateTo) : mixed
Parameters
$normalizedData : mixed
$dateFrom : Date
$dateTo : Date

fillReport()

Fill report handler properties from Report entity.

public fillReport(Report $report) : void
Parameters
$report : Report

Report entity.

getCalculatedData()

Fix base method - return array only

public getCalculatedData() : mixed
Tags
override

getCategoryKey()

public getCategoryKey() : string
Return values
string

getClassName()

public static getClassName() : string
Return values
string

getCollectedFormElements()

public getCollectedFormElements() : array<string|int, Base>
Return values
array<string|int, Base>

getConfiguration()

TODO@ optimise this

public getConfiguration(string $key) : Configuration|null
Parameters
$key : string

Unique key to find configuration.

Return values
Configuration|null

getDatesRange()

Returns range of dates starting with from date and ending with to date.

public static getDatesRange(Date $from, Date $to[, string $step = self::STEP_DAY ]) : Generator<string|int, Date>
Parameters
$from : Date

Date to start with.

$to : Date
$step : string = self::STEP_DAY

Interval to add on each iteration, has 2 predefined values: BaseGraph::STEP_DAY andBaseGraph::STEP_MONTH.

Tags
throws
ArgumentException
Return values
Generator<string|int, Date>

getFormElement()

In form elements list find form element with key $fieldKey.

public getFormElement(string $fieldKey) : Base|BaseValuable|null
Parameters
$fieldKey : string

Unique key to find form element.

Return values
Base|BaseValuable|null

getFormElementByDataAttribute()

Find form element by attribute key value pair.

public getFormElementByDataAttribute(string $attributeKey, string $value) : Base|null
Parameters
$attributeKey : string

Attribute key to find in form elements list.

$value : string

Value of attribute name for needle form element.

Return values
Base|null

getFormElementFromCollected()

public getFormElementFromCollected(string $key) : Base|BaseValuable|null
Parameters
$key : string

Unique key to fine element in form elements list.

Return values
Base|BaseValuable|null

getFormElements()

public getFormElements() : array<string|int, Base>
Return values
array<string|int, Base>

getFormElementValue()

Returns value of the form element with given key.

public getFormElementValue(string $fieldKey) : mixed|null
Parameters
$fieldKey : string

The key of the field.

Return values
mixed|null

getGroupByOptions()

public getGroupByOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMultipleData()

array with format array( 'items' => array( array( 'label' => 'Some Title', 'value' => 5, 'targetUrl' => 'http://url.domain?params=param' ) ) )

public getMultipleData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMultipleDemoData()

public getMultipleDemoData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMultipleGroupedData()

Array format for return this method:<br> array( 'items' => array( array( 'groupBy' => 01.01.1970 or 15 etc.

public getMultipleGroupedData() : array<string|int, mixed>

'title' => 'Some Title', 'value' => 1, 'targetUrl' => 'http://url.domain?params=param' ), array( 'groupBy' => 01.01.1970 or 15 etc. 'title' => 'Some Title', 'value' => 2, 'targetUrl' => 'http://url.domain?params=param' ) ), 'config' => array( 'groupsLabelMap' => array( '01.01.1970' => 'Start of our internet evolution' '15' => 'Just a simple integer' ), 'reportTitle' => 'Some title for this report' ) )

Return values
array<string|int, mixed>

getMultipleGroupedDemoData()

public getMultipleGroupedDemoData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getReportImplementedDataTypes()

public getReportImplementedDataTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSingleData()

array with format array( 'title' => 'Some Title', 'value' => 0, 'targetUrl' => 'http://url.domain?params=param' )

public getSingleData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSingleDemoData()

public getSingleDemoData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTargetUrl()

public getTargetUrl(mixed $baseUri[, mixed $params = [] ]) : mixed
Parameters
$baseUri : mixed
$params : mixed = []

getTitle()

public getTitle() : string
Return values
string

getUnitKey()

public getUnitKey() : string
Return values
string

getUserInfo()

Returns [id, name, link, icon] for the specified use id.

public getUserInfo(int $userId[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|null
Parameters
$userId : int

Id of the user.

$params : array<string|int, mixed> = []

Additional optional parameters

  • avatarWidth int
  • avatarHeight int
  • Return values
    array<string|int, mixed>|null

    getWhatWillCalculateOptions()

    public getWhatWillCalculateOptions([null $groupingValue = null ]) : array<string|int, mixed>
    Parameters
    $groupingValue : null = null

    Grouping field value.

    Return values
    array<string|int, mixed>

    isEnabled()

    In some case, need to dynamically disable some report handler

    public isEnabled() : bool
    Return values
    bool

    mutateFilterParameter()

    public mutateFilterParameter(mixed $filterParameters, array<string|int, mixed> $fieldList) : array<string|int, mixed>
    Parameters
    $filterParameters : mixed
    $fieldList : array<string|int, mixed>
    Return values
    array<string|int, mixed>

    padNormalizedData()

    public padNormalizedData(mixed &$normalizedData) : mixed
    Parameters
    $normalizedData : mixed

    preloadUserInfo()

    public preloadUserInfo(array<string|int, mixed> $userIds) : mixed
    Parameters
    $userIds : array<string|int, mixed>

    prepare()

    Called every time when calculate some report result before passing some concrete handler, such us getMultipleData or getSingleData.

    public prepare() : mixed

    Here you can get result of configuration fields of report, if report in widget you can get configurations of widget.

    prepareEntityListFilter()

    public prepareEntityListFilter(mixed $requestParameters) : mixed
    Parameters
    $requestParameters : mixed

    removeFormElement()

    Remove from form elements list form element.

    public removeFormElement(Base $element) : bool
    Parameters
    $element : Base

    Element to remove.

    Return values
    bool

    setCalculatedData()

    public setCalculatedData(mixed $calculatedData) : void
    Parameters
    $calculatedData : mixed

    Report handler calculated data.

    setConfigurations()

    public setConfigurations(array<string|int, Configuration$configurations) : void
    Parameters
    $configurations : array<string|int, Configuration>

    Configuration list to set.

    setFormElements()

    Setter to set form elements multiply.

    public setFormElements(array<string|int, Base$formElementList) : void
    Parameters
    $formElementList : array<string|int, Base>

    Form elements to set in form.

    setTitle()

    public setTitle(string $title) : void
    Parameters
    $title : string

    Title of report handler.

    setView()

    public setView(View $view) : void
    Parameters
    $view : View

    View entity to set of handler.

    setWeight()

    public setWeight(mixed $weight) : void
    Parameters
    $weight : mixed

    Weight value for sorting.

    setWidgetHandler()

    Attach report handler to widget handler.

    public setWidgetHandler(BaseWidget $widgetHandler) : void
    Parameters
    $widgetHandler : BaseWidget

    Widget handler.

    updateFormElementValue()

    public updateFormElementValue(BaseValuable|string $formElement, mixed $value) : bool
    Parameters
    $formElement : BaseValuable|string

    Form element which need to update.

    $value : mixed

    New value for form element.

    Return values
    bool
    
            
    On this page

    Search results