public function getNumeric($names)
    {
        $data = $this->get($names, 'numeric');

        $resultIndices = $this->getResultIndices();
        $result = $data->getIndexedArray($resultIndices);

        // if only one metric is returned, just return it as a numeric value
        if (empty($resultIndices)
            && count($result) <= 1
            && (!is_array($names) || count($names) == 1)
        ) {
            $result = (float)reset($result); // convert to float in case $result is empty
        }

        return $result;
    }
public function getNumeric($names)
    {
        $data = $this->get($names, 'numeric');

        $resultIndices = $this->getResultIndices();
        $result = $data->getIndexedArray($resultIndices);

        // if only one metric is returned, just return it as a numeric value
        if (empty($resultIndices)
            && count($result) <= 1
            && (!is_array($names) || count($names) == 1)
        ) {
            $result = (float)reset($result); // convert to float in case $result is empty
        }

        return $result;
    }
public function getNumeric ( $ names ) { $ data = $ this -> get ( $ names , 'numeric' ) ; $ resultIndices = $ this -> getResultIndices ( ) ; $ result = $ data -> getIndexedArray ( $ resultIndices ) ; // if only one metric is returned, just return it as a numeric value if ( empty ( $ resultIndices ) && count ( $ result ) <= 1 && ( ! is_array ( $ names ) || count ( $ names ) == 1 ) ) { $ result = ( float ) reset ( $ result ) ; // convert to float in case $result is empty } return $ result ; }
Queries and returns metric data in an array.

If multiple sites were requested in {@link build()} or {@link factory()} the result will
be indexed by site ID.

If multiple periods were requested in {@link build()} or {@link factory()} the result will
be indexed by period.

The site ID index is always first, so if multiple sites & periods were requested, the result
will be indexed by site ID first, then period.

@param string|array $names One or more archive names, eg, `'nb_visits'`, `'Referrers_distinctKeywords'`,
etc.
@return false|integer|array `false` if there is no data to return, a single numeric value if we're not querying
for multiple sites/periods, or an array if multiple sites, periods or names are
queried for.
Queries and returns metric data in an array .