Prado\Web\UI\WebControls\TDataGrid::bubbleEvent PHP Method

bubbleEvent() public method

If the event parameter is {@link TDataGridCommandEventParameter} and the command name is a recognized one, which includes 'select', 'edit', 'delete', 'update', and 'cancel' (case-insensitive), then a corresponding command event is also raised (such as {@link onEditCommand OnEditCommand}). This method should only be used by control developers.
public bubbleEvent ( $sender, $param ) : boolean
return boolean whether the event bubbling should stop here.
    public function bubbleEvent($sender, $param)
    {
        if ($param instanceof TDataGridCommandEventParameter) {
            $this->onItemCommand($param);
            $command = $param->getCommandName();
            if (strcasecmp($command, self::CMD_SELECT) === 0) {
                $this->setSelectedItemIndex($param->getItem()->getItemIndex());
                $this->onSelectedIndexChanged($param);
                return true;
            } else {
                if (strcasecmp($command, self::CMD_EDIT) === 0) {
                    $this->onEditCommand($param);
                    return true;
                } else {
                    if (strcasecmp($command, self::CMD_DELETE) === 0) {
                        $this->onDeleteCommand($param);
                        return true;
                    } else {
                        if (strcasecmp($command, self::CMD_UPDATE) === 0) {
                            $this->onUpdateCommand($param);
                            return true;
                        } else {
                            if (strcasecmp($command, self::CMD_CANCEL) === 0) {
                                $this->onCancelCommand($param);
                                return true;
                            } else {
                                if (strcasecmp($command, self::CMD_SORT) === 0) {
                                    $this->onSortCommand(new TDataGridSortCommandEventParameter($sender, $param));
                                    return true;
                                } else {
                                    if (strcasecmp($command, self::CMD_PAGE) === 0) {
                                        $p = $param->getCommandParameter();
                                        if (strcasecmp($p, self::CMD_PAGE_NEXT) === 0) {
                                            $pageIndex = $this->getCurrentPageIndex() + 1;
                                        } else {
                                            if (strcasecmp($p, self::CMD_PAGE_PREV) === 0) {
                                                $pageIndex = $this->getCurrentPageIndex() - 1;
                                            } else {
                                                if (strcasecmp($p, self::CMD_PAGE_FIRST) === 0) {
                                                    $pageIndex = 0;
                                                } else {
                                                    if (strcasecmp($p, self::CMD_PAGE_LAST) === 0) {
                                                        $pageIndex = $this->getPageCount() - 1;
                                                    } else {
                                                        $pageIndex = TPropertyValue::ensureInteger($p) - 1;
                                                    }
                                                }
                                            }
                                        }
                                        $this->onPageIndexChanged(new TDataGridPageChangedEventParameter($sender, $pageIndex));
                                        return true;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return false;
    }