protected function isDuplicateRoleServiceAccess($rsa)
    {
        $roleId = array_get($rsa, 'role_id');
        $serviceId = array_get($rsa, 'service_id');
        $component = array_get($rsa, 'component');
        $verbMask = array_get($rsa, 'verb_mask');
        $requestorMask = array_get($rsa, 'requestor_mask');

        if (is_null($serviceId)) {
            $servicePhrase = "service_id is NULL";
        } else {
            $servicePhrase = "service_id = '$serviceId'";
        }

        if (is_null($component)) {
            $componentPhrase = "component is NULL";
        } else {
            $componentPhrase = "component = '$component'";
        }

        return RoleServiceAccess::whereRaw(
            "role_id = '$roleId' AND 
            $servicePhrase AND 
            $componentPhrase AND 
            verb_mask = '$verbMask' AND 
            requestor_mask = '$requestorMask'"
        )->exists();
    }
protected function isDuplicateRoleServiceAccess($rsa)
    {
        $roleId = array_get($rsa, 'role_id');
        $serviceId = array_get($rsa, 'service_id');
        $component = array_get($rsa, 'component');
        $verbMask = array_get($rsa, 'verb_mask');
        $requestorMask = array_get($rsa, 'requestor_mask');

        if (is_null($serviceId)) {
            $servicePhrase = "service_id is NULL";
        } else {
            $servicePhrase = "service_id = '$serviceId'";
        }

        if (is_null($component)) {
            $componentPhrase = "component is NULL";
        } else {
            $componentPhrase = "component = '$component'";
        }

        return RoleServiceAccess::whereRaw(
            "role_id = '$roleId' AND 
            $servicePhrase AND 
            $componentPhrase AND 
            verb_mask = '$verbMask' AND 
            requestor_mask = '$requestorMask'"
        )->exists();
    }
protected function isDuplicateRoleServiceAccess ( $ rsa ) { $ roleId = array_get ( $ rsa , 'role_id' ) ; $ serviceId = array_get ( $ rsa , 'service_id' ) ; $ component = array_get ( $ rsa , 'component' ) ; $ verbMask = array_get ( $ rsa , 'verb_mask' ) ; $ requestorMask = array_get ( $ rsa , 'requestor_mask' ) ; if ( is_null ( $ serviceId ) ) { $ servicePhrase = "service_id is NULL" ; } else { $ servicePhrase = "service_id = '$serviceId'" ; } if ( is_null ( $ component ) ) { $ componentPhrase = "component is NULL" ; } else { $ componentPhrase = "component = '$component'" ; } return RoleServiceAccess :: whereRaw ( "role_id = '$roleId' AND 
            $servicePhrase AND 
            $componentPhrase AND 
            verb_mask = '$verbMask' AND 
            requestor_mask = '$requestorMask'" ) -> exists ( ) ; }
Checks for duplicate role_service_access relation.

@param $rsa

@return bool
Checks for duplicate role_service_access relation .