Returns a list of Transaction entities in JSON format.

@return JsonResponse

@Route("/advert/{id}/list.{_format}", requirements={ "_format" = "json" }, defaults={ "_format" = "json" })
@Method("GET")
422317
public function advertListJsonAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $advert = $em->getRepository('EcommerceBundle:Advert')->find($id);
        /** @var \Kitchenit\AdminBundle\Services\DataTables\JsonList $jsonList */
        $jsonList = $this->get('json_list');
        $jsonList->setRepository($em->getRepository('EcommerceBundle:Transaction'));
        $jsonList->setAdvertId($advert->getId());
        $response = $jsonList->get();

        return new JsonResponse($response);
    }
96651
public function listJsonAction()
    {
        $em = $this->getDoctrine()->getManager();
        $adminManager = $this->get('admin_manager');
        /** @var \AdminBundle\Services\DataTables\JsonList $jsonList */
        $jsonList = $this->get('json_list');
        $jsonList->setRepository($em->getRepository('EcommerceBundle:Product'));
        $user = $this->container->get('security.token_storage')->getToken()->getUser();
        if ($user->isGranted('ROLE_USER')) {
            $jsonList->setActor($user);
        }
        
        $response = $jsonList->get();

        return new JsonResponse($response);
    }
327234
public function listAction()
    {
        $request = $this->getRequest();

        $this->admin->checkAccess('list');

        $preResponse = $this->preList($request);
        if (null !== $preResponse) {
            return $preResponse;
        }

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $formView = $datagrid->getForm()->createView();

        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFilterTheme());

        // NEXT_MAJOR: Remove this line and use commented line below it instead
        $template = $this->admin->getTemplate('list');
        // $template = $this->templateRegistry->getTemplate('list');

        return $this->renderWithExtraParams($template, [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
            'export_formats' => $this->has('sonata.admin.admin_exporter') ?
                $this->get('sonata.admin.admin_exporter')->getAvailableFormats($this->admin) :
                $this->admin->getExportFormats(),
        ], null);
    }
449040
public function modelList()
    {
        $this->action = self::API_ACTION_LIST;
        $code = 200;
        list($return, $total, $pages) = $this->getList();
        $message = null;
        if(!$total) {
            $message = t('No se han encontrado elementos para la búsqueda');
        }

        return $this->json(new JsonResponse($return, $code === 200, $total, $pages, $message), $code);
    }
954444
public function getStorableData()
    {
        return [
            'id' => 'Transaction',
            'flat' => [
                'Total' => \Heystack\Ecommerce\convertMoneyToString($this->total),
                'Status' => $this->status,
                'Currency' => $this->currencyService->getActiveCurrencyCode()
            ],
            'related' => []
        ];

    }
1145881
public function getJsonItemSchemas()
	{
		$list = [];

		foreach( $this->getControllers() as $name => $controller ) {
			$list[$name] = $controller->getItemSchema();
		}

		if( ( $json = json_encode( $list ) ) === null ) {
			throw new \RuntimeException( 'Unable to encode schemas to JSON' );
		}

		return $json;
	}
1250886
public static function toListObj($transactions_data)
    {
        $transactions = array();
        if(!empty($transactions_data['transactions'][0]['id'])){
            foreach ($transactions_data['transactions'] as $transaction) {
                $transactions[] = (object) $transaction;
            }
        }
        $return = new StdClass;
        $return->transactions = $transactions;

        return $return;
    }
180571
public function request()
    {
        $transactions = $this->searchTransactions();

        if(count($transactions) > 0) {
            foreach ($transactions as $transaction) {
                $this->_arrayTransactions[] = array(
                    'date'           => $this->formatDate($transaction['created_at']),
                    'magento_id'     => $transaction['increment_id'],
                    'pagseguro_id'   => $transaction['transaction_code'],
                    'environment'    => $transaction['environment'],
                    'magento_status' => $this->formatMagentoStatus($transaction['status'], $transaction['partially_refunded']),
                    'order_id'       => $transaction['entity_id']
                );
            }
        }
        return $this->_arrayTransactions;
    }
1042981
def ToJson(self):
        
        items = []

        for i in self.Items:
            items.append({'index': i.index, 'height': i.height})

        return {
            'version': self.StateVersion,
            'txHash': self.TransactionHash.ToString(),
            'txHeight': self.TransactionHeight,
            'items': items
        }
947949
public function jsonSerialize()
    {
        $output = [];
        foreach ($this::getReflection()->getProperties() as $propertyName => $property) {

            $value = $this->{$propertyName};
            if ($value instanceof Entity\Collection || $value instanceof Entity) {
                $output[$propertyName] = $value->jsonSerialize();
            } elseif ($value instanceof \DateTime
                && $property->getType() === Entity\Reflection\Property::TYPE_DATE
            ) {
                $output[$propertyName] = (array) $value;
                $output[$propertyName]["date"] = $value->format(self::$dateFormat);
            } else {
                $output[$propertyName] = $value;
            }
        }

        return $output;
    }
68842
public function getPayloadJSON()
    {
        $data = is_string($this->data) ? mb_convert_encoding($this->data, 'UTF-8') : $this->data;
        return json_encode($data);
    }
979149
protected function getPaymentTransactionStructure()
    {
        return [
            'gaming'                    => $this->gaming,
            'moto'                      => $this->moto,
            'notification_url'          => $this->notification_url,
            'return_success_url'        => $this->return_success_url,
            'return_failure_url'        => $this->return_failure_url,
            'amount'                    => $this->transformAmount($this->amount, $this->currency),
            'currency'                  => $this->currency,
            'card_holder'               => $this->card_holder,
            'card_number'               => $this->card_number,
            'cvv'                       => $this->cvv,
            'expiration_month'          => $this->expiration_month,
            'expiration_year'           => $this->expiration_year,
            'customer_email'            => $this->customer_email,
            'customer_phone'            => $this->customer_phone,
            'document_id'               => $this->document_id,
            'birth_date'                => $this->birth_date,
            'billing_address'           => $this->getBillingAddressParamsStructure(),
            'shipping_address'          => $this->getShippingAddressParamsStructure(),
            'mpi_params'                => $this->getMpiParamsStructure(),
            'risk_params'               => $this->getRiskParamsStructure(),
            'dynamic_descriptor_params' => $this->getDynamicDescriptorParamsStructure()
        ];
    }
933566
public function getList()
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        $mode = $routeMatch->getParam('mode', false);
        $annee = $routeMatch->getParam('annee', 0);
        $processStateHandler = $this->getProcessStateHandler();
        $processes = $processStateHandler->getRunningProcessList($mode, $annee);
        $response = $this->getResponse();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $serializer = $this->getSerializer();
        $processJson = $serializer->serialize($processes, 'json');
        $response->setContent($processJson);
        return $response;
    }
49523
public function indexAction()
    {
        $templates = $this->get('doctrine.orm.entity_manager')->getRepository('VictoireTemplateBundle:Template')->findByTemplate(null, ['position' => 'ASC']);

        return new JsonResponse(
            [
                'success' => true,
                'html'    => $this->container->get('templating')->render(
                    'VictoireTemplateBundle:Template:index.html.twig',
                    ['templates' => $templates]
                ),
            ]
        );
    }
699540
public function jsonTasksList() {    
        $controller = new JsonController();
        $controller
            ->restrictAccess(Auth::isAdmin());
    
        // Generate an AJAX/JSON response for datatables to load a block of rows
        $search = Filter::postArray('search');
        if($search) $search = $search['value'];
        $start  = Filter::postInteger('start');
        $length = Filter::postInteger('length');
        $order  = Filter::postArray('order');
    
		$order_by_name = false;
        foreach($order as $key => &$value) {
            switch($value['column']) {
                case 3:
					$order_by_name = true;
                    unset($order[$key]);
                    break;
                case 4;
					$value['column'] = 'majat_last_run';
					break;
				case 4;
					$value['column'] = 'majat_last_result';
					break;
                default:
                    unset($order[$key]);
            }
        }
    
        $list = $this->provider->getFilteredTasksList($search, $order, $start, $length);
		if($order_by_name) {
			usort($list, function(AbstractTask $a, AbstractTask $b) { return I18N::strcasecmp($a->getTitle(), $b->getTitle()); });
		}
        $recordsFiltered = count($list);
        $recordsTotal = $this->provider->getTasksCount();
    
        $data = array();
        foreach($list as $task) {    
            $datum = array();
			
            $datum[0] = '
                <div class="btn-group">
                    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                        <i class="fa fa-pencil"></i><span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                       <li>
                            <a href="#" onclick="return set_admintask_status(\''. $task->getName().'\', '.($task->isEnabled() ? 'false' : 'true').');">
                                <i class="fa fa-fw '.($task->isEnabled() ? 'fa-times' : 'fa-check').'"></i> ' . ($task->isEnabled() ? I18N::translate('Disable') : I18N::translate('Enable')) . '
                            </a>
                       </li>
                        <li>
                            <a href="module.php?mod='.$this->module->getName().'&mod_action=Task@edit&task='. $task->getName().'">
                                <i class="fa fa-fw fa-pencil"></i> ' . I18N::translate('Edit') . '
                            </a>
                       </li>
                    </ul>
                </div>';
            $datum[1] = $task->getName();
            $datum[2] = $task->isEnabled() ? 
				'<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Enabled').'</span>' : 
				'<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('Disabled').'</span>';
            $datum[3] = $task->getTitle();
            $date_format = str_replace('%', '', I18N::dateFormat()) . ' H:i:s';
			$datum[4] = $task->getLastUpdated()->format($date_format);
            $datum[5] = $task->isLastRunSuccess() ? 
				'<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Yes').'</span>' : 
				'<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('No').'</span>';
            $dtF = new \DateTime('@0');
            $dtT = new \DateTime('@' . ($task->getFrequency() * 60));            
            $datum[6] = $dtF->diff($dtT)->format(I18N::translate('%a d %h h %i m'));
			$datum[7] = $task->getRemainingOccurrences() > 0 ? I18N::number($task->getRemainingOccurrences()) : I18N::translate('Unlimited');
			$datum[8] = $task->isRunning() ? 
				'<i class="fa fa-cog fa-spin fa-fw"></i><span class="sr-only">'.I18N::translate('Running').'</span>' : 
				'<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('Not running').'</span>';
			if($task->isEnabled() && !$task->isRunning()) {
			    $datum[9] = '
    			    <button id="bt_runtask_'. $task->getName() .'" class="btn btn-primary" href="#" onclick="return run_admintask(\''. $task->getName() .'\')">
    			         <div id="bt_runtasktext_'. $task->getName() .'"><i class="fa fa-cog fa-fw" ></i>' . I18N::translate('Run') . '</div>
    			    </button>';
			}
			else {
			    $datum[9] = '';
			}			    
						
            $data[] = $datum;
        }
    
        $controller->pageHeader();
    
        $controller->encode(array(
            'draw'            => Filter::getInteger('draw'),
            'recordsTotal'    => $recordsTotal,
            'recordsFiltered' => $recordsFiltered,
            'data'            => $data
        ));
    
    }
931094
public function ajax(): JsonResponse
    {
        $transformer = app()->make('InetStudio\Comments\Contracts\Transformers\Back\CommentTransformerContract');

        return DataTables::of($this->query())
            ->setTransformer($transformer)
            ->rawColumns(['checkbox', 'read', 'active', 'material', 'actions'])
            ->make();
    }
1363081
public function listJsonAction(Request $request)
    {
        $totalEntities = $this->countTotal();
                
        $offset = intval($request->get('iDisplayStart'));
        $limit = intval($request->get('iDisplayLength'));
        $sortColumn = intval($request->get('iSortCol_0'));
        $sortDirection = $request->get('sSortDir_0');
        $search = $request->get('sSearch');
        $echo = intval($request->get('sEcho'));
        
        $entities = $this->findAllForDataTables($search, $sortColumn, $sortDirection, null, $request->getLocale());
        
        $totalFilteredEntities = count($entities->getScalarResult());

        // paginate
        $entities->setFirstResult($offset)
            ->setMaxResults($limit);

        $data = $entities->getResult();


        $response = array(
            'iTotalRecords'         => $totalEntities,
            'iTotalDisplayRecords'  => $totalFilteredEntities,
            'sEcho'                 => $echo,
            'aaData'                => $data
        );
        

        return new JsonResponse($response);
    }