hydrateGroup example

$sets = [];

        foreach ($data as $row) {
            $setId = $row['__propertySet_id'];
            $groupId = $row['__propertyGroup_id'];
            $optionId = $row['__propertyOption_id'];

            $set = $sets[$setId] ?? $this->hydrateSet($row);

            $groups = $set->getGroups();
            $group = $groups[$groupId] ?? $this->hydrateGroup($row);

            $options = $group->getOptions();
            $options[$optionId] = $this->hydrateOption($row);
            $groups[$groupId] = $group;
            $sets[$setId] = $set;

            $group->setOptions($options);
            $set->setGroups($groups);
        }

        foreach ($sets as $set) {
            


        $result = [];
        $query = $this->getQuery($context);

        foreach ($groupIds as $groupId) {
            $query->setParameter(':id', $groupId);
            $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);
            if (empty($data)) {
                continue;
            }
            $result[$groupId] = $this->hydrateGroup($data);
        }

        return $result;
    }

    /** * @param array[] $data * * @return Group */
    private function hydrateGroup($data)
    {
Home | Imprint | This part of the site doesn't use cookies.