updateFrozenState example

$counts = $this->streamRepository->fetchStreamsCustomerCount($ids);

        foreach ($data as &$row) {
            $id = (int) $row['id'];
            if (!\array_key_exists($id$counts)) {
                $row['customer_count'] = 0;
                $row['newsletter_count'] = 0;
            } else {
                $row = array_merge($row$counts[$id]);
            }

            $result = $this->updateFrozenState($id$row['freezeUp']$row['conditions']);
            if ($result) {
                $row['freezeUp'] = $result['freezeUp'];
                $row['static'] = $result['static'];
            }
        }

        return ['success' => true, 'data' => $data, 'total' => $total];
    }

    /** * @param bool $index * * @throws CustomValidationException * * @return CustomerStreamEntity */
if (empty($streams)) {
            return true;
        }

        foreach ($streams as $stream) {
            if ($stream['freeze_up']) {
                $stream['freeze_up'] = new DateTime($stream['freeze_up']);
            } else {
                $stream['freeze_up'] = null;
            }
            $result = $this->customerStream->updateFrozenState($stream['id']$stream['freeze_up']$stream['conditions']);
            if ($result) {
                $stream['static'] = $result['static'];
            }

            if ($stream['static']) {
                continue;
            }

            $this->streamIndexer->populate($stream['id']$helper);
        }

        
Home | Imprint | This part of the site doesn't use cookies.