Destiny\AdvisorsTwo\ActivityTier::__construct PHP Метод

__construct() публичный Метод

public __construct ( array $properties )
$properties array
    public function __construct(array $properties)
    {
        $properties['definition'] = manifest()->activity($properties['activityHash']);
        $properties['activityData'] = new ActivityData($properties['activityData']);
        if (isset($properties['extended']['rounds'])) {
            $rounds = [];
            foreach ($properties['extended']['rounds'] as $k => $round) {
                $round = new ArenaRound($this, $round);
                $round->roundNumber = $k + 1;
                $rounds[$round->roundNumber] = $round;
            }
            $properties['rounds'] = $rounds;
        }
        if (isset($properties['rewards'])) {
            $rewards = [];
            foreach ($properties['rewards'] as $rewardGroup) {
                foreach ($rewardGroup['rewardItems'] as $item) {
                    if (!in_array($item['itemHash'], $this->skippedRewards)) {
                        $rewards[] = new Reward($properties['activityData']->displayLevel, $item);
                    }
                }
            }
            $properties['rewards'] = $rewards;
        }
        if (isset($properties['extended']['skullCategories'])) {
            $skulls = [];
            foreach ($properties['extended']['skullCategories'] as $skullCategory) {
                foreach ($skullCategory['skulls'] as $skull) {
                    $skull = new SkullModifier($skull);
                    $skull->isModifier = $skullCategory['title'] === "Modifiers";
                    $skulls[] = $skull;
                }
            }
            $properties['skulls'] = $skulls;
        }
        if (isset($properties['skullCategories'])) {
            $skulls = [];
            foreach ($properties['skullCategories'] as $skullCategory) {
                foreach ($skullCategory['skulls'] as $skull) {
                    $skull = new SkullModifier($skull);
                    $skull->isModifier = $skullCategory['title'] === "Modifiers";
                    $skulls[] = $skull;
                }
            }
            // Add heroic skull if HM
            if ($properties['tierDisplayName'] === "Hard") {
                $skulls[] = $properties['definition']->skulls->first();
            }
            $properties['skulls'] = $skulls;
            $this->raid = true;
        }
        if (isset($properties['completion'])) {
            $properties['completion'] = new Completion($properties['completion']);
        }
        parent::__construct($properties);
    }