public function serializeConditionCollection(ConditionCollection $collection)
    {
        if ($collection->count() == 0) {
            /** @var ConditionInterface $conditionNone */
            $conditionNone = $this->container->get(
                'thelia.condition.match_for_everyone'
            );
            $collection[] = $conditionNone;
        }
        $serializableConditions = [];
        /** @var $condition ConditionInterface */
        foreach ($collection as $condition) {
            $serializableConditions[] = $condition->getSerializableCondition();
        }

        return base64_encode(json_encode($serializableConditions));
    }
public function serializeConditionCollection(ConditionCollection $collection)
    {
        if ($collection->count() == 0) {
            /** @var ConditionInterface $conditionNone */
            $conditionNone = $this->container->get(
                'thelia.condition.match_for_everyone'
            );
            $collection[] = $conditionNone;
        }
        $serializableConditions = [];
        /** @var $condition ConditionInterface */
        foreach ($collection as $condition) {
            $serializableConditions[] = $condition->getSerializableCondition();
        }

        return base64_encode(json_encode($serializableConditions));
    }
public function serializeConditionCollection ( ConditionCollection $ collection ) { if ( $ collection -> count ( ) == 0 ) { /** @var ConditionInterface $conditionNone */ $ conditionNone = $ this -> container -> get ( 'thelia.condition.match_for_everyone' ) ; $ collection [ ] = $ conditionNone ; } $ serializableConditions = [ ] ; /** @var $condition ConditionInterface */ foreach ( $ collection as $ condition ) { $ serializableConditions [ ] = $ condition -> getSerializableCondition ( ) ; } return base64_encode ( json_encode ( $ serializableConditions ) ) ; }
Serialize a collection of conditions

@param ConditionCollection $collection A collection of conditions

@return string A ready to be stored Condition collection
Serialize a collection of conditions