Выполним действие

@return array

@version 24.12.2018
@author  Дмитрий Щербаков <atomcms@ya.ru>
551299
public function run()
    {
        $this->getLastActionDates();
        $this->getInfoUsers();

        return Response::data([
            'count' => $this->info_users_count,
            'items' => $this->info_users_items,
        ]);
    }
724361
public function toArray()
    {
        return array(
            'scheme' => $this->scheme,
            'host' => $this->host,
            'port' => $this->port,
            'user' => $this->user,
            'pass' => $this->pass,
            'path' => $this->path,
            'query' => $this->query,
            'fragment' => $this->fragment
        );
    }
869993
public function toArray()
	{
		return array(
			$this->_prefix . 'id' => $this->getId(),
			$this->_prefix . 'siteid' => $this->getSiteId(),
			$this->_prefix . 'ctime' => $this->getTimeCreated(),
			$this->_prefix . 'mtime' => $this->getTimeModified(),
			$this->_prefix . 'editor' => $this->getEditor(),
		);
	}
1059700
private function loadContentTypes()
    {
        $result[0] = array();
        $result[1] = array();

        /*
         * Стандартные типы контента
         */
        $result[0] []= admPagesContentDefault;
        $result[1] []= 'default';

        $result[0] []= admPagesContentList;
        $result[1] []= 'list';

        $result[0] []= admPagesContentURL;
        $result[1] []= 'url';

        /*
         * Типы контентов из плагинов
         */
        $plugins = Eresus_Plugin_Registry::getInstance();
        foreach ($plugins->getEnabled() as $plugin)
        {
            if (
                $plugin instanceof ContentPlugin ||
                $plugin instanceof TContentPlugin
            )
            {
                $result[0][] = $plugin->title;
                $result[1][] = $plugin->name;
            }
        }

        return $result;
    }
191084
public function toArray()
    {
        return [
            'userAgent'          => $this->userAgent,
            'browser'            => $this->browser,
            'version'            => $this->version,
            'majorVersion'       => $this->majorVersion,
            'minorVersion'       => $this->minorVersion,
            'browserWithVersion' => $this->browserWithVersion,
            'publisher'          => $this->publisher,
            'platform'           => $this->platform,
            'device'             => $this->device,
            'devicePointer'      => $this->devicePointer,
            'isMobile'           => $this->isMobile,
            'isTablet'           => $this->isTablet(),
            'isCrawler'          => $this->isCrawler,
        ];
    }
812968
public function toArray()
    {
        $packet = $this->getPacket();

        return array(
            'id'           => (string)$this->id,
            'hostname'     => (string)$packet['hostname'],
            'pid'          => (int)$packet['pid'],

            'queues'       => array(
                'selected' => (array)explode(',', $packet['queues']),
                'resolved' => (array)$this->resolveQueues()
            ),
            'shutdown'     => (bool)$packet['shutdown'],
            'blocking'     => (bool)$packet['blocking'],
            'status'       => (int)$packet['status'],
            'interval'     => (int)$packet['interval'],
            'timeout'      => (int)$packet['timeout'],
            'memory'       => (int)$packet['memory'],
            'memory_limit' => (int)$packet['memory_limit'] * 1024 * 1024,

            'started'      => (float)$packet['started'],
            'processed'    => (int)$packet['processed'],
            'cancelled'    => (int)$packet['cancelled'],
            'failed'       => (int)$packet['failed'],

            'job_id'       => (string)$packet['job_id'],
            'job_pid'      => (int)$packet['job_pid'],
            'job_started'  => (float)$packet['job_started'],
        );
    }
902613
public function pages()
    {
        $links[] = [__d('me_cms', 'List pages'), [
            'controller' => 'Pages',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admins and managers can access these actions
        if ($this->Auth->isGroup(['admin', 'manager'])) {
            $links[] = [__d('me_cms', 'Add page'), [
                'controller' => 'Pages',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'List categories'), [
                'controller' => 'PagesCategories',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add category'), [
                'controller' => 'PagesCategories',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        $links[] = [__d('me_cms', 'List static pages'), [
            'controller' => 'Pages',
            'action' => 'indexStatics',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        return [$links, I18N_PAGES, ['icon' => 'far copy']];
    }
614618
public function toArray()
    {
        return [
            'name' => $this->name,
            'class-name' => $this->className,
            'path' => $this->path,
            'is-create' => $this->isCreate,
            'is-virtual' => $this->isVirtual,
            'is-organized' => $this->isOrganized,
            'with-soft-delete' => $this->withSoftDelete,
            'without-timestamps' => $this->withoutTimestamps,
            'resource' => ($this->resource ?: new Resource())->toArray(),
        ];
    }
1335228
public function toArray()
    {
        $data = array(
            'domain'      => $this->_domain,
            'type'		  => $this->_type,
            'package'	  => $this->_package,
            'path'		  => $this->_path,
            'name'		  => $this->_name,
        );

        return $data;
    }
153394
public function getData(): array
    {
        return [
            $this->serverOriginScheme,
            $this->serverOriginHost,
            $this->serverOriginPort,
            $this->isPreFlightCanBeCached,
            $this->preFlightCacheMaxAge,
            $this->isForceAddMethods,
            $this->isForceAddHeaders,
            $this->isUseCredentials,
            $this->areAllOriginsAllowed,
            $this->allowedOrigins,
            $this->areAllMethodsAllowed,
            $this->allowedLcMethods,
            $this->allowedMethodsList,
            $this->areAllHeadersAllowed,
            $this->allowedLcHeaders,
            $this->allowedHeadersList,
            $this->exposedHeadersList,
            $this->isCheckHost,
        ];
    }
515765
public function getCMSFields()
    {
        $self = $this;
   
        $this->beforeUpdateCMSFields(function ($fields) use ($self) {
            $siteconfig = SiteConfig::current_site_config();

            $fields->removeByName("StartDate");
            $fields->removeByName("CustomerID");
            $fields->removeByName("EndDate");
            $fields->removeByName("Number");
            $fields->removeByName("Ref");
            $fields->removeByName("AccessKey");
            $fields->removeByName("Items");
            $fields->removeByName("Prefix");
            
            $fields->addFieldsToTab(
                "Root.Main",
                [
                    // Items field
                    ReadOnlyGridField::create(
                        "Items",
                        "",
                        $this->Items(),
                        $config = GridFieldConfig::create()
                            ->addComponents(
                                new GridFieldButtonRow('before'),
                                new GridFieldTitleHeader(),
                                new GridFieldEditableColumns(),
                                new GridFieldEditButton(),
                                new GridFieldDetailForm(),
                                new GridFieldDeleteAction(),
                                new AddLineItem()
                            )
                    ),

                    LiteralField::create(
                        "ItemsDivider",
                        '<div class="field form-group"></div>'
                    ),
                    
                    // Totals and settings
                    CompositeField::create(
                        CompositeField::create(
                            DateField::create("StartDate", _t("OrdersAdmin.Date", "Date")),
                            DateField::create("EndDate", _t("OrdersAdmin.Expires", "Expires")),
                            ReadonlyField::create("FullRef", "#"),
                            TextField::create("Ref", $this->fieldLabel("Ref"))
                        )->setName("OrdersDetailsInfo")
                        ->addExtraClass("col"),
                        CompositeField::create([])
                            ->setName("OrdersDetailsMisc")
                        ->addExtraClass("col"),
                        CompositeField::create(
                            ReadonlyField::create("SubTotalValue", _t("OrdersAdmin.SubTotal", "Sub Total"))
                                ->setValue($this->obj("SubTotal")->Nice()),
                            ReadonlyField::create("TaxValue", _t("OrdersAdmin.Tax", "Tax"))
                                ->setValue($this->obj("TaxTotal")->Nice()),
                            ReadonlyField::create("TotalValue", _t("OrdersAdmin.Total", "Total"))
                                ->setValue($this->obj("Total")->Nice())
                        )->setName("OrdersDetailsTotals")
                        ->addExtraClass("col")
                    )->setName("OrdersDetails")
                    ->addExtraClass("orders-details-field")
                    ->setColumnCount(2)
                    ->setFieldHolderTemplate("SilverCommerce\\OrdersAdmin\\Forms\\OrderDetailsField_holder")
                ]
            );

            $fields->addFieldsToTab(
                "Root.Customer",
                [
                    HasOneButtonField::create(
                        $this,
                        'Customer'
                    ),
                    TextField::create("Company"),
                    TextField::create("FirstName"),
                    TextField::create("Surname"),
                    TextField::create("Address1"),
                    TextField::create("Address2"),
                    TextField::create("City"),
                    TextField::create("County"),
                    TextField::create("PostCode"),
                    DropdownField::create(
                        'Country',
                        _t('OrdersAdmin.Country', 'Country'),
                        i18n::getData()->getCountries()
                    )->setEmptyString(""),
                    TextField::create("Email"),
                    TextField::create("PhoneNumber")
                ]
            );

            $fields->addFieldsToTab(
                "Root.Delivery",
                [
                    HeaderField::create(
                        "DeliveryDetailsHeader",
                        _t("Orders.DeliveryDetails", "Delivery Details")
                    ),
                    TextField::create("DeliveryCompany"),
                    TextField::create("DeliveryFirstName"),
                    TextField::create("DeliverySurname"),
                    TextField::create("DeliveryAddress1"),
                    TextField::create("DeliveryAddress2"),
                    TextField::create("DeliveryCity"),
                    TextField::create("DeliveryCounty"),
                    TextField::create("DeliveryPostCode"),
                    DropdownField::create(
                        'DeliveryCountry',
                        _t('OrdersAdmin.Country', 'Country'),
                        i18n::getData()->getCountries()
                    )->setEmptyString("")
                ]
            );

            $fields->addFieldToTab(
                "Root.History",
                VersionHistoryField::create(
                    "History",
                    _t("SilverCommerce\VersionHistoryField.History", "History"),
                    $self
                )->addExtraClass("stacked")
            );
            
            $root = $fields->findOrMakeTab("Root");

            if ($root) {
                $root->addextraClass('orders-root');
            }
        });
        
        return parent::getCMSFields();
    }
805821
public function getCMSFields()
    {
        $fields = new FieldList();
        $fields->push(new TabSet('Root', new Tab('Main')));

        if (Permission::check('REASSIGN_ACTIVE_WORKFLOWS')) {
            if ($this->WorkflowStatus == 'Paused' || $this->WorkflowStatus == 'Active') {
                $cmsUsers = Member::mapInCMSGroups();

                $fields->addFieldsToTab('Root.Main', array(
                    new HiddenField('DirectUpdate', '', 1),
                    new HeaderField(
                        'InstanceReassignHeader',
                        _t('WorkflowInstance.REASSIGN_HEADER', 'Reassign workflow')
                    ),
                    new CheckboxSetField('Users', _t('WorkflowDefinition.USERS', 'Users'), $cmsUsers),
                    new TreeMultiselectField('Groups', _t('WorkflowDefinition.GROUPS', 'Groups'), Group::class)
                ));
            }
        }

        if ($this->canEdit()) {
            $action = $this->CurrentAction();
            if ($action->exists()) {
                $actionFields = $this->getWorkflowFields();
                $fields->addFieldsToTab('Root.Main', $actionFields);

                $transitions = $action->getValidTransitions();
                if ($transitions) {
                    $fields->replaceField(
                        'TransitionID',
                        DropdownField::create("TransitionID", "Next action", $transitions->map())
                    );
                }
            }
        }

        $items = WorkflowActionInstance::get()->filter(array(
            'Finished'   => 1,
            'WorkflowID' => $this->ID
        ));

        $grid = new GridField(
            'Actions',
            _t('WorkflowInstance.ActionLogTitle', 'Log'),
            $items
        );

        $fields->addFieldsToTab('Root.Main', $grid);

        return $fields;
    }
1078957
public function toArray()
    {
        return [
            'text' => $this->getText($this->getModel()),
            'attributes' => $this->getConditionAttributes($this->model)->htmlAttributesToString(),
            'url' => $this->getUrl($this->getModel()),
            'position' => $this->getPosition(),
            'icon' => $this->getIcon(),
            'hideText' => $this->hideText,
        ];
    }
92021
public function getModulesAsArray()
    {

        // initialize the array for the modules
        $modules = array();

        // iterate over the module nodes and sort them into an array
        /** @var \AppserverIo\Appserver\Core\Api\Node\ModuleNode $module */
        foreach ($this->getModules() as $module) {
            $modules[$module->getUuid()] = $module->getType();
        }

        // return the array
        return $modules;
    }
701721
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            "Root.Main",
            array(
                DropdownField::create(
                    'FormPageID',
                    'Select a page',
                    UserDefinedForm::get()->map('ID', 'Title')
                )
            )
        );

        $this->extend('updateCMSFields', $fields);

        return $fields;
    }
1287976
public function getList()
    {
        $app = App::get();
        $list = $app->data->getList()
                ->filterBy('key', 'bearcms/addons/addon/', 'startWith');
        $result = [];
        foreach ($list as $item) {
            $result[] = $this->makeAddonFromRawData($item->value);
        }
        return new \IvoPetkov\DataList($result);
    }
1288092
protected function getColumns(): array
    {
        return [
            ['data' => 'checkbox', 'name' => 'checkbox', 'title' => view('admin.module.comments::back.partials.datatables.checkbox')
                ->render(), 'orderable' => false, 'searchable' => false],
            ['data' => 'read', 'name' => 'is_read', 'title' => 'Прочитано', 'searchable' => false],
            ['data' => 'active', 'name' => 'is_active', 'title' => 'Активность', 'searchable' => false],
            ['data' => 'name', 'name' => 'name', 'title' => 'Имя'],
            ['data' => 'email', 'name' => 'email', 'title' => 'Email'],
            ['data' => 'message', 'name' => 'message', 'title' => 'Сообщение'],
            ['data' => 'created_at', 'name' => 'created_at', 'title' => 'Дата создания'],
            ['data' => 'material', 'name' => 'material', 'title' => 'Материал', 'orderable' => false, 'searchable' => false],
            ['data' => 'actions', 'name' => 'actions', 'title' => 'Действия', 'orderable' => false, 'searchable' => false],
        ];
    }