<commit_before><?php

namespace waylaidwanderer\Steamlytics\CSGO;


class Pricelist
{
    private $pricesItems;

    public function __construct($json)
    {
        $this->pricesItems = [];
        foreach ($json['items'] as $marketHashName => $pricesItemJson) {
            if ($pricesItemJson['volume'] > 0) {
                $this->pricesItems[$marketHashName] = new PricesItem($marketHashName, $pricesItemJson);
            }
        }
    }

    /**
     * @param $marketHashName
     * @return PricesItem|null
     */
    public function getPrice($marketHashName) {
        if (isset($this->pricesItems[$marketHashName])) {
            return $this->pricesItems[$marketHashName];
        }
        return null;
    }

    /**
     * @param $marketHashName
     * @return bool
     */
    public function doesItemExist($marketHashName) {
        return isset($this->pricesItems[$marketHashName]);
    }

    /**<commit_msg>Updated Pricelist object with missing properties<commit_after><?php

namespace waylaidwanderer\Steamlytics\CSGO;


class Pricelist
{
    private $pricesItems;
    private $fromTimestamp;
    private $buildTime;
    private $updatedAtTimestamp;

    public function __construct($json)
    {
        $this->pricesItems = [];
        foreach ($json['items'] as $marketHashName => $pricesItemJson) {
            if ($pricesItemJson['volume'] > 0) {
                $this->pricesItems[$marketHashName] = new PricesItem($marketHashName, $pricesItemJson);
            }
        }
        $this->fromTimestamp = $json['from'];
        $this->buildTime = $json['build_time'];
        $this->updatedAtTimestamp = $json['updated_at'];
    }

    /**
     * @return int
     */
    public function getFromTimestamp()
    {
        return $this->fromTimestamp;
    }

    /**
     * @return int
     */
    public function getBuildTime()
    {
        return $this->buildTime;
    }

    /**
     * @return int
     */
    public function getUpdatedAtTimestamp()
    {
        return $this->updatedAtTimestamp;
    }

    /**
     * @param $marketHashName
     * @return PricesItem|null
     */
    public function getPrice($marketHashName) {
        if (isset($this->pricesItems[$marketHashName])) {
            return $this->pricesItems[$marketHashName];
        }
        return null;
    }

    /**
     * @param $marketHashName
     * @return bool
     */
    public function doesItemExist($marketHashName) {
        return isset($this->pricesItems[$marketHashName]);
    }

    /**
{'fraction_non_alphanumeric': 0.12984418697562924, 'fraction_numerical': 0.0007990411506192569, 'mean_word_length': 2.320954907161804, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7614306', 'n_tokens_mistral': 751, 'n_tokens_neox': 730, 'n_words': 128}