Retrieve Vehicle Stats

@access public
@return object JSON
489707
public function retrieveVehicleStats ()
    {
        $data = file_get_contents("http://battlefield.play4free.com/en/profile/stats/" .$this->_profileID. "/" .$this->_soldierID. "?g=[%22VehicleStats%22]");
        $vehicleStats = json_decode($data);
        return $vehicleStats;
    }
693952
public function stats() {
		$res = [];

		$query = $this->find();
		$list = $query
			->select(['count' => $query->count(), 'country_id'])
			->group('country_id')
			->hydrate(false)
			->all();

		foreach ($list as $x) {
			$res[$x['country_id']] = (int)$x['count'];
		}

		return $res;
	}
480814
protected function toJson()
    {
        $serializedActionResults = [];

        foreach ($this->results as $action => $result) {
            $serializedActionResults[$action] = serialize($result);
        }

        $responseData = [
            'requestId' => $this->requestId,
            'actionResults' => $serializedActionResults
        ];

        return json_encode($responseData);
    }
802417
public function getStats()
    {
        $result = [
            self::STATS_QUEUES_LIST   => [],
            self::STATS_JOBS_TOTAL    => 0,
            self::STATS_JOBS_READY    => 0,
            self::STATS_JOBS_RESERVED => 0,
            self::STATS_JOBS_DELAYED  => 0,
            self::STATS_JOBS_BURIED   => 0,
        ];

        $queueList = $this->getQueueNames();
        if (count($queueList) == 0) {
            return $result;
        }

        $result[self::STATS_QUEUES_LIST] = $queueList;

        foreach ($queueList as $queueName) {
            $itemStats = $this->getQueueInfo($queueName);
            $result[self::STATS_JOBS_READY] += $itemStats[self::STATS_JOBS_READY];
            $result[self::STATS_JOBS_RESERVED] += $itemStats[self::STATS_JOBS_RESERVED];
            $result[self::STATS_JOBS_DELAYED] += $itemStats[self::STATS_JOBS_DELAYED];
            $result[self::STATS_JOBS_BURIED] += $itemStats[self::STATS_JOBS_BURIED];
            $result[self::STATS_JOBS_TOTAL] += $itemStats[self::STATS_JOBS_TOTAL];
            $result[self::STATS_QUEUES][$queueName] = $itemStats;
        }

        return $result;
    }
103586
public function jsonSerialize()
    {
        $invocable = $this->getInvocable();
        if (is_object($invocable) && !$invocable instanceof \JsonSerializable) {
            $invocable = get_class($invocable);
        }
        return [
            'invocable' => $invocable,
            'params'    => $this->getParameters(),
            'id'        => $this->getId(),
            'status'    => $this->getStatus(),
            'report'    => $this->getReport(),
            'label'     => $this->getLabel(),
            'type'     => $this->getType(),
            'added'     => $this->getCreationDate(),
            'owner'     => $this->getOwner(),
        ];
    }
321582
def stats(self):
        
        response = self.requester.get(
            '/{endpoint}/{id}/stats',
            endpoint=self.endpoint, id=self.id
        )
        return response.json()
155159
public function getData()
  {
    // Return public properties
    $dataVars = call_user_func('get_object_vars', $this);

    if (count($dataVars) > 0)
    {
      array_walk_recursive(
        $dataVars,
        function (&$value)
        {
          if ($value instanceof AbstractEnum)
          {
            /** @var $value AbstractEnum */
            $value = $value->getValue();
          }
          elseif ($value instanceof Response)
          {
            $value = $value->getData();
          }
          elseif ($value instanceof ResponseArray)
          {
            $value = $value->getResponses();
          }
        }
      );
    }

    return $dataVars;
  }
512668
public function jsonSerialize()
		{
			$data               = (object) [];
			$data->type         = 'folder';
			$data->name         = $this->name;
			$data->route        = $this->route;
			$data->parents      = $this->parents;
			$data->folders      = $this->folders;
			$data->controllers  = $this->controllers;
			return $data;
		}
1371117
public function retrieveRushMapStats () 
    {
        $data = file_get_contents("http://battlefield.play4free.com/en/profile/stats/" .$this->_profileID. "/" .$this->_soldierID. "?g=[%22RushMapStats%22]&_?=1351945928776");
        $rushMapStats = json_decode($data);
        return $rushMapStats;
    }
108155
public function json() {
			$json = parent::json();

			$is_contact_visible = $this->fs->is_page_visible( 'contact' );
			$is_support_visible = $this->fs->is_page_visible( 'support' );

			$json['theme_title'] = $this->fs->get_plugin_name();

			if ( $is_contact_visible && $is_support_visible ) {
				$json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' );
			}

			if ( $is_contact_visible ) {
				$json['contact'] = array(
					'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ),
					'url'   => $this->fs->contact_url(),
				);
			}

			if ( $is_support_visible ) {
				$json['support'] = array(
					'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ),
					'url'   => $this->fs->get_support_forum_url()
				);
			}

			return $json;
		}
352738
public function getStat()
    {
        $stat   = array(
            'ino'       => 0,
            'mode'      => (array_key_exists('mode', $this->objectInfo)) ? $this->objectInfo['mode'] : 0,
            'nlink'     => 0,
            'uid'       => 0,
            'gid'       => 0,
            'rdev'      => 0,
            'size'      => (array_key_exists('size', $this->objectInfo)) ? $this->objectInfo['size'] : 0,
            'atime'     => 0,
            'mtime'     => 0,
            'ctime'     => 0,
            'blksize'   => -1,
            'blocks'    => -1,
        );
        return array_merge($stat, array_values($stat));
    }
1050276
public function toWebDriver()
    {
        return [
            'type' => (count($this->actions) > 0) ? 'actions' : 'text',
            'text' => $this->text,
            'fallback' => $this->fallback,
            'callback_id' => $this->callback_id,
            'actions' => $this->actions,
        ];
    }
133616
public function getData()
    {
        $result = [
            'type' => $this->type
        ];

        switch($this->type)
        {
            case self::TYPE_POSTBACK:
                $result['title'] = $this->title;
                $result['payload'] = $this->url;
            break;

            case self::TYPE_CALL:
                $result['title'] = $this->title;
                $result['payload'] = $this->url;
            break;

            case self::TYPE_WEB:
              $result['title'] = $this->title;
              $result['url'] = $this->url;

              if ($this->webview_height_ratio) {
                  $result['webview_height_ratio'] = $this->webview_height_ratio;
              }

              if ($this->messenger_extensions){
                  $result['messenger_extensions'] = $this->messenger_extensions;
                  $result['fallback_url'] = $this->fallback_url;
              }
              
              if($this->webview_share_button){
                  $result['webview_share_button'] = $this->webview_share_button ;
              }
            break;

            case self::TYPE_SHARE:
              //only share_contents needed
               if ($this->share_contents)
                $result['share_contents'] = $this->share_contents->getData();
            break;

            case self::TYPE_ACCOUNT_LINK:
                $result['url'] = $this->url;
            break;

            case self::TYPE_ACCOUNT_UNLINK:
              //only type needed
            break;

        }

        return $result;
    }
56615
public function getJson()
    {
        if (empty($this->json_loaded)) {
            if ($this->getBody() && $this->isJson()) {
                $this->json = json_decode($this->getBody(), true);

                if (json_last_error()) {
                    throw new RuntimeException('Failed to parse JSON. Reason: ' . json_last_error_msg());
                }
            }

            $this->json_loaded = true;
        }

        return $this->json;
    }
300528
public function getData()
    {
        if ($this->getTestMode()) {
            $this->validate('testKey');
        } else {
            $this->validate('signKey');
        }

        $result = [];
        $vars = array_merge($this->httpRequest->query->all(), $this->httpRequest->request->all());
        foreach ($vars as $key => $parameter) {
            if (strpos($key, 'ik_') === 0) {
                $result[$key] = $parameter;
            }
        }

        return $result;
    }
676172
public function ajaxGetVisits()
    {
        $data = Base::getVisitsRepository()->orderBy('created_at', 'desc')->take(300)->get(['url', 'browser', 'ip', 'created_at', 'country']);

        return \Response::json(array('data' => $data));
    }
649718
public function getDriverNameByWeight()
    {
        $count = $base = 0;
        $map = [];
        foreach ($this->drivers as $driver) {
            $count += $driver->weight;
            if ($driver->weight) {
                $max = $base + $driver->weight;
                $map[] = [
                    'min'    => $base,
                    'max'    => $max,
                    'driver' => $driver->name,
                ];
                $base = $max;
            }
        }
        if ($count <= 0) {
            return;
        }
        $number = mt_rand(0, $count - 1);
        foreach ($map as $data) {
            if ($number >= $data['min'] && $number < $data['max']) {
                return $data['driver'];
            }
        }
    }