@param mixed $use_customer_key

@return Realm
454
public function setUseCustomerKey( $use_customer_key )
	{
		$this->use_customer_key = ($use_customer_key == 1 || $use_customer_key == 'Y' || $use_customer_key === TRUE) ? TRUE : FALSE;

		return $this;
	}
1037661
public function get($key, $and = true, $useMaster = false, $tablePrefix = null)
    {
        if (is_string($useMaster) && is_null($tablePrefix)) {
            $tablePrefix = $useMaster;
            $useMaster = false;
        }

        is_null($tablePrefix) && $tablePrefix = $this->tablePrefix;

        list($tableName, $condition) = $this->parseKey($key, $and);

        $filter = [];
        isset($this->sql['limit'][0]) && $filter['skip'] = $this->sql['limit'][0];
        isset($this->sql['limit'][1]) && $filter['limit'] = $this->sql['limit'][1];

        return $this->runMongoQuery($tablePrefix . $tableName, $condition, $filter, $useMaster);
    }
238356
protected static function deleteCustomerByIdAsyncWithHttpInfo($customer_id) 
    {
        $returnType = '';  
        $request = self::deleteCustomerByIdRequest($customer_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
1072644
public function import(array $users = array(), $realm = 'Restricted area')
    {
        //realm must be a string
        Argument::i()->test(2, 'string');
        
        $this->realm = $realm;
        $self = $this;
        
        return function (Registry $request, Registry $response) use ($users, $self) {
            //get digest
            $digest = $request->get('server', 'PHP_AUTH_DIGEST');
            
            //if no digest
            if (empty($digest)) {
                //this throws anyways
                return $self->dialog();
            }
            
            // analyze the PHP_AUTH_DIGEST variable
            $data = $self->digest($digest);
            
            //if no username
            if (!isset($users[$data['username']])) {
                //this throws anyways
                return $self->dialog();
            }
            
            // generate the valid response
            $signature = $self->getSignature($users, $data);
            
            //if it doesnt match
            if ($data['response'] !== $signature) {
                //this throws anyways
                return $self->dialog();
            }
        };
    }
10891
public function showCustomer($customer_id)
    {
        $response = $this->client->get('customers/' . $customer_id);
        return json_decode($response->getBody())->customer;
    }
26021
public function deleteCustomer($customer_id)
    {
        $response = $this->client->delete('customers/' . $customer_id);
        return json_decode($response->getBody())->customer;
    }
374461
public function getServer ( $consumer_key, $user_id, $user_is_admin = false )
	{
		
                //
                $sql = "BEGIN SP_GET_SERVER(:P_CONSUMER_KEY, :P_USER_ID, :P_ROWS, :P_RESULT); END;";

                // parse sql
                $stmt = oci_parse($this->conn, $sql) or die ('Can not parse query');

                // Bind In and Out Variables
                oci_bind_by_name($stmt, ':P_CONSUMER_KEY', $consumer_key, 255);                
                oci_bind_by_name($stmt, ':P_USER_ID', $user_id, 40);
                oci_bind_by_name($stmt, ':P_RESULT', $result, 20);

                //Bind the ref cursor
                $p_row = oci_new_cursor($this->conn);
                oci_bind_by_name($stmt, ':P_ROWS', $p_row, -1, OCI_B_CURSOR);

                //Execute the statement
                oci_execute($stmt);

                // treat the ref cursor as a statement resource
                oci_execute($p_row, OCI_DEFAULT);
                oci_fetch_all($p_row, $getServerList, null, null, OCI_FETCHSTATEMENT_BY_ROW);
                $r = $getServerList;
                //
		if (empty($r))
		{
			throw new OAuthException2('No server with consumer_key "'.$consumer_key.'" has been registered (for this user)');
		}
			
		if (isset($r['signature_methods']) && !empty($r['signature_methods']))
		{
			$r['signature_methods'] = explode(',',$r['signature_methods']);
		}
		else
		{
			$r['signature_methods'] = array();
		}
		return $r;
	}
401585
private function hydrateCustomerWithSubEntities(
        HalResource $customerResource,
        CustomerRequest $customerRequest
    ): Customer {
        $customerLoader = new CustomerLoader(
            $this->restClient,
            $customerResource,
            $customerRequest->getLinks()
        );
        $customerLoader->load();

        return $customerResource->getEntity();
    }
611444
public function receiveTokenAndUsername($consumer_key, $request_token)
    {
        $pocketData = $this->convertRequestToken($consumer_key, $request_token);

        $returnData['access_token'] = $pocketData->access_token;
        $returnData['username'] = $pocketData->username;
        
        return $returnData;
    }
1167944
protected function performPingRequest($useCache = true)
    {
        $cacheKey = (string)($this);
        if ($useCache && isset(static::$pingCache[$cacheKey])) {
            return static::$pingCache[$cacheKey];
        }

        $pingQuery = $this->client->createPing();
        $pingResult = $this->createAndExecuteRequest($pingQuery);

        if ($useCache) {
            static::$pingCache[$cacheKey] = $pingResult;
        }

        return $pingResult;
    }
997482
public function setCustomer($customer)
    {
        $this->client->addQueryString('new_customer', false);

        if ($customer instanceof Customers) {
            $code = $customer->code;
        } else {
            $code = $customer;
        }

        $this->data->customer = new stdClass;
        $this->data->customer->code = $code;

        return $this;
    }
453642
function lookup_consumer($consumerKey)
    {

        return new OAuth\OAuthConsumer($this->toolProvider->consumer->getKey(),
           $this->toolProvider->consumer->secret);

    }
728728
public function getClientKey($client_id, $subject)
    {
        if (isset($this->jwt[$client_id])) {
            $jwt = $this->jwt[$client_id];
            if ($jwt) {
                if ($jwt["subject"] == $subject) {
                    return $jwt["key"];
                }
            }
        }

        return null;
    }
4279
public function get($key = null, $cache_cb = null, &$cas_token = null)
    {

        if (isset($this->cacheListing [$key])) {
            return parent::get($key, $cache_cb, $cas_token);
        }

        return false;
    }
379208
public function update($customer)
    {
        $customerId = "";

        if (is_array($customer)) {
            $customerId = $customer["id"];
        }
        elseif (is_object($customer)) {
            $customerId = $customer->id;
        }

        return $this->client->put("/customers/" . rawurlencode($customerId), $customer, null);
    }
982484
public function countServerTokens ( $consumer_key )
	{
		
                //
                $count =0;
                $sql = "BEGIN SP_COUNT_SERVICE_TOKENS(:P_CONSUMER_KEY, :P_COUNT, :P_RESULT); END;";

                // parse sql
                $stmt = oci_parse($this->conn, $sql) or die ('Can not parse query');

                // Bind In and Out Variables
                oci_bind_by_name($stmt, ':P_CONSUMER_KEY', $consumer_key, 255);
                oci_bind_by_name($stmt, ':P_COUNT', $count, 40);
                oci_bind_by_name($stmt, ':P_RESULT', $result, 20);
                
                //Execute the statement
                oci_execute($stmt);                
                //
		return $count;
	}
656071
public function setUseCommerce(string $use_commerce = "F") : CNabuDataObject
    {
        if ($use_commerce === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$use_commerce")
            );
        }
        $this->setValue('nb_site_target_use_commerce', $use_commerce);
        
        return $this;
    }