Export/Exporter.php
private function validate(array $options)
    {
        if (array_key_exists('mandatorId', $options)) {
            $options['mandatorId'] = (int) $options['mandatorId'];
        }

        list($customerId, $licenseKey) =
            $this->siteAccessHelper->getRecommendationServiceCredentials($options['mandatorId'], $options['siteaccess']);

        $options = array_filter($options, function ($val) {
            return $val !== null;
        });

        $resolver = new OptionsResolver();
        $resolver->setRequired(['contentTypeIdList', 'host', 'webHook', 'transaction']);
        $resolver->setDefined(array_keys($options));
        $resolver->setDefaults([
            'transaction' => (new \DateTime())->format('YmdHis') . rand(111, 999),
            'customerId' => $customerId,
            'licenseKey' => $licenseKey,
            'mandatorId' => null,
            'siteaccess' => null,
            'lang' => null,
        ]);

        return $resolver->resolve($options);
    }
private function validate(array $options)
    {
        if (array_key_exists('mandatorId', $options)) {
            $options['mandatorId'] = (int) $options['mandatorId'];
        }

        list($customerId, $licenseKey) =
            $this->siteAccessHelper->getRecommendationServiceCredentials($options['mandatorId'], $options['siteaccess']);

        $options = array_filter($options, function ($val) {
            return $val !== null;
        });

        $resolver = new OptionsResolver();
        $resolver->setRequired(['contentTypeIdList', 'host', 'webHook', 'transaction']);
        $resolver->setDefined(array_keys($options));
        $resolver->setDefaults([
            'transaction' => (new \DateTime())->format('YmdHis') . rand(111, 999),
            'customerId' => $customerId,
            'licenseKey' => $licenseKey,
            'mandatorId' => null,
            'siteaccess' => null,
            'lang' => null,
        ]);

        return $resolver->resolve($options);
    }
private function validate ( array $ options ) { if ( array_key_exists ( 'mandatorId' , $ options ) ) { $ options [ 'mandatorId' ] = ( int ) $ options [ 'mandatorId' ] ; } list ( $ customerId , $ licenseKey ) = $ this -> siteAccessHelper -> getRecommendationServiceCredentials ( $ options [ 'mandatorId' ] , $ options [ 'siteaccess' ] ) ; $ options = array_filter ( $ options , function ( $ val ) { return $ val !== null ; } ) ; $ resolver = new OptionsResolver ( ) ; $ resolver -> setRequired ( [ 'contentTypeIdList' , 'host' , 'webHook' , 'transaction' ] ) ; $ resolver -> setDefined ( array_keys ( $ options ) ) ; $ resolver -> setDefaults ( [ 'transaction' => ( new \ DateTime ( ) ) -> format ( 'YmdHis' ) . rand ( 111 , 999 ) , 'customerId' => $ customerId , 'licenseKey' => $ licenseKey , 'mandatorId' => null , 'siteaccess' => null , 'lang' => null , ] ) ; return $ resolver -> resolve ( $ options ) ; }
Validates required options.

@param array $options

@return array
Validates required options .