protected function checkIdParameter($by)
    {
        $allowedForBy = [
            'externalId',
            'id'
        ];

        if (!in_array($by, $allowedForBy, false)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Value "%s" for "by" param is not valid. Allowed values are %s.',
                    $by,
                    implode(', ', $allowedForBy)
                )
            );
        }

        return true;
    }
protected function checkIdParameter($by)
    {
        $allowedForBy = [
            'externalId',
            'id'
        ];

        if (!in_array($by, $allowedForBy, false)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Value "%s" for "by" param is not valid. Allowed values are %s.',
                    $by,
                    implode(', ', $allowedForBy)
                )
            );
        }

        return true;
    }
protected function checkIdParameter ( $ by ) { $ allowedForBy = [ 'externalId' , 'id' ] ; if ( ! in_array ( $ by , $ allowedForBy , false ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Value "%s" for "by" param is not valid. Allowed values are %s.' , $ by , implode ( ', ' , $ allowedForBy ) ) ) ; } return true ; }
Check ID parameter

@param string $by identify by

@throws \InvalidArgumentException

@return bool
Check ID parameter