PHPCap Docs | PHPCap API
Overview

Namespaces

  • IU
    • PHPCap
  • PHP

Classes

  • IU\PHPCap\ErrorHandler
  • IU\PHPCap\FileUtil
  • IU\PHPCap\RedCap
  • IU\PHPCap\RedCapApiConnection
  • IU\PHPCap\RedCapProject

Interfaces

  • IU\PHPCap\ErrorHandlerInterface
  • IU\PHPCap\RedCapApiConnectionInterface

Exceptions

  • Exception
  • IU\PHPCap\PhpCapException
  • Overview
  • Namespace
  • Class
  1:   2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12:  13:  14:  15:  16:  17:  18:  19:  20:  21:  22:  23:  24:  25:  26:  27:  28:  29:  30:  31:  32:  33:  34:  35:  36:  37:  38:  39:  40:  41:  42:  43:  44:  45:  46:  47:  48:  49:  50:  51:  52:  53:  54:  55:  56:  57:  58:  59:  60:  61:  62:  63:  64:  65:  66:  67:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 
<?php

/**
 * Contains interface for classes implementing a connection to a REDCap API.
 */

namespace IU\PHPCap;

/**
 * Interface for connection to the API of a REDCap instance.
 * Classes implementing this interface are used to provide low-level
 * access to the REDCap API.
 */
interface RedCapApiConnectionInterface
{

    /**
     * Constructor that creates a REDCap API connection for the specified URL, with the
     * specified settings.
     *
     * @param string $url
     *            the URL for the API of the REDCap site that you want to connect to.
     * @param boolean $sslVerify indicates if verification should be done for the SSL
     *            connection to REDCap. Setting this to false is not secure.
     * @param string $caCertificateFile
     *            the CA (Certificate Authority) certificate file used for veriying the REDCap site's
     *            SSL certificate (i.e., for verifying that the REDCap site that is
     *            connected to is the one specified).
     * @param ErrorHandlerInterface $errorHandler the error handler for the connection.
     */
    public function __construct(
        $url,
        $sslVerify,
        $caCertificateFile,
        $errorHandler
    );

    /**
     * Destructor for this class.
     */
    public function __destruct();

    /**
     * Makes a call to REDCap's API and returns the results.
     *
     * @param mixed $data
     *         data for the call.
     * @throws PhpCapException
     * @return string the response returned by the REDCap API for the specified call data.
     *         See the REDCap API documentation for more information.
     */
    public function call($data);
    
    /**
     * Calls REDCap's API using a with a correctly formatted string version
     * of the specified array and returns the results.
     *
     * @param $dataArray array the array of data that is converted to a
     *         string and then passed to the REDCap API.
     * @throws PhpCapException
     * @return string the response returned by the REDCap API for the specified call data.
     *         See the REDCap API documentation for more information.
     */
    public function callWithArray($dataArray);
    
    /**
     *  Returns call information for the most recent call.
     *  The format of the call information will be connection dependent.
     */
    public function getCallInfo();
    
    /**
     * Gets the error handler for the connection.
     *
     * return ErrorHandlerInterface the error handler for the connection.
     */
    public function getErrorHandler();
    
    /**
     * Sets the error handler;
     *
     * @param ErrorHandlerInterface $errorHandler the error handler to use.
     */
    public function setErrorHandler($errorHandler);

    /**
     * Gets the URL of the connection.
     *
     * return string the URL of the connection.
     */
    public function getUrl();
    
    /**
     * Sets the URL of the connection.
     *
     * @param string $url the URL of the connection.
     */
    public function setUrl($url);
    
    /**
     * Gets the status of SSL verification for the connection.
     *
     * @return boolean true if SSL verification is enabled, and false otherwise.
     */
    public function getSslVerify();
    
    /**
     * Sets SSL verification for the connection.
     *
     * @param boolean $sslVerify if this is true, then the site being connected to will
     *     have its SSL certificate verified.
     */
    public function setSslVerify($sslVerify);
    
    
    /**
     * Gets the timeout in seconds for calls to the connection.
     *
     * @return integer timeout in seconds for calls to connection.
     */
    public function getTimeoutInSeconds();
    
    
    /**
     * Sets the timeout in seconds for calls to the connection.
     *
     * @param $timeoutInSeconds timeout in seconds for call to connection.
     */
    public function setTimeoutInSeconds($timeoutInSeconds);
    
    /**
     * Gets the timeout for time to make a connection in seconds.
     *
     * @return integer connection timeout in seconds.
     */
    public function getConnectionTimeoutInSeconds();
    
    /**
     * Sets the timeout for time to make a connection in seconds.
     *
     * @param integer connection timeout in seconds.
     */
    public function setConnectionTimeoutInSeconds($connectionTimeoutInSeconds);
}
PHPCap API documentation generated by ApiGen