public function reverseMap($data): PolicyCreateStruct
    {
        if (!$data instanceof PolicyCreateData) {
            throw new InvalidArgumentException('data', 'must be an instance of ' . PolicyCreateData::class);
        }

        $policyCreateStruct = new PolicyCreateStruct([
            'module' => $data->getModule(),
            'function' => $data->getFunction(),
        ]);

        foreach ($data->getLimitations() as $limitation) {
            if (!empty($limitation->limitationValues)) {
                $policyCreateStruct->addLimitation($limitation);
            }
        }

        return $policyCreateStruct;
    }
public function reverseMap($data): PolicyCreateStruct
    {
        if (!$data instanceof PolicyCreateData) {
            throw new InvalidArgumentException('data', 'must be an instance of ' . PolicyCreateData::class);
        }

        $policyCreateStruct = new PolicyCreateStruct([
            'module' => $data->getModule(),
            'function' => $data->getFunction(),
        ]);

        foreach ($data->getLimitations() as $limitation) {
            if (!empty($limitation->limitationValues)) {
                $policyCreateStruct->addLimitation($limitation);
            }
        }

        return $policyCreateStruct;
    }
public function reverseMap ( $ data ) : PolicyCreateStruct { if ( ! $ data instanceof PolicyCreateData ) { throw new InvalidArgumentException ( 'data' , 'must be an instance of ' . PolicyCreateData :: class ) ; } $ policyCreateStruct = new PolicyCreateStruct ( [ 'module' => $ data -> getModule ( ) , 'function' => $ data -> getFunction ( ) , ] ) ; foreach ( $ data -> getLimitations ( ) as $ limitation ) { if ( ! empty ( $ limitation -> limitationValues ) ) { $ policyCreateStruct -> addLimitation ( $ limitation ) ; } } return $ policyCreateStruct ; }
Maps given PolicyCreateData object to a PolicyCreateStruct object.

@param PolicyCreateData $data

@return PolicyCreateStruct

@throws InvalidArgumentException
Maps given PolicyCreateData object to a PolicyCreateStruct object .