public function createProject(
        $projectData,
        $format = 'php',
        $odm = null
    ) {
        // Note: might want to clone error handler, in case state variables
        // have been added that should differ for different uses, e.g.,
        // a user message that is displayed where you have multiple project
        // objects
        $data = array(
                'token'        => $this->superToken,
                'content'      => 'project',
                'returnFormat' => 'json'
        );
        
        #---------------------------------------------
        # Process the arguments
        #---------------------------------------------
        $legalFormats = array('csv', 'json', 'php', 'xml');
        $data['format'] = $this->processFormatArgument($format, $legalFormats);
        $data['data']   = $this->processImportDataArgument($projectData, 'projectData', $format);
        
        if (isset($odm)) {
            $data['odm'] = $this->processOdmArgument($odm);
        }
        
        #---------------------------------------
        # Create the project
        #---------------------------------------
        $apiToken = $this->connection->callWithArray($data);
        
        $this->processNonExportResult($apiToken);
        
        $connection   = clone $this->connection;
        $errorHandler = clone $this->errorHandler;
        
        $projectConstructorCallback = $this->projectConstructorCallback;
        
        $project = call_user_func(
            $projectConstructorCallback,
            $apiUrl = null,
            $apiToken,
            $sslVerify = null,
            $caCertificateFile = null,
            $errorHandler,
            $connection
        );
        
        return $project;
    }
public function createProject(
        $projectData,
        $format = 'php',
        $odm = null
    ) {
        // Note: might want to clone error handler, in case state variables
        // have been added that should differ for different uses, e.g.,
        // a user message that is displayed where you have multiple project
        // objects
        $data = array(
                'token'        => $this->superToken,
                'content'      => 'project',
                'returnFormat' => 'json'
        );
        
        #---------------------------------------------
        # Process the arguments
        #---------------------------------------------
        $legalFormats = array('csv', 'json', 'php', 'xml');
        $data['format'] = $this->processFormatArgument($format, $legalFormats);
        $data['data']   = $this->processImportDataArgument($projectData, 'projectData', $format);
        
        if (isset($odm)) {
            $data['odm'] = $this->processOdmArgument($odm);
        }
        
        #---------------------------------------
        # Create the project
        #---------------------------------------
        $apiToken = $this->connection->callWithArray($data);
        
        $this->processNonExportResult($apiToken);
        
        $connection   = clone $this->connection;
        $errorHandler = clone $this->errorHandler;
        
        $projectConstructorCallback = $this->projectConstructorCallback;
        
        $project = call_user_func(
            $projectConstructorCallback,
            $apiUrl = null,
            $apiToken,
            $sslVerify = null,
            $caCertificateFile = null,
            $errorHandler,
            $connection
        );
        
        return $project;
    }
public function createProject ( $ projectData , $ format = 'php' , $ odm = null ) { // Note: might want to clone error handler, in case state variables // have been added that should differ for different uses, e.g., // a user message that is displayed where you have multiple project // objects $ data = array ( 'token' => $ this -> superToken , 'content' => 'project' , 'returnFormat' => 'json' ) ; #--------------------------------------------- # Process the arguments #--------------------------------------------- $ legalFormats = array ( 'csv' , 'json' , 'php' , 'xml' ) ; $ data [ 'format' ] = $ this -> processFormatArgument ( $ format , $ legalFormats ) ; $ data [ 'data' ] = $ this -> processImportDataArgument ( $ projectData , 'projectData' , $ format ) ; if ( isset ( $ odm ) ) { $ data [ 'odm' ] = $ this -> processOdmArgument ( $ odm ) ; } #--------------------------------------- # Create the project #--------------------------------------- $ apiToken = $ this -> connection -> callWithArray ( $ data ) ; $ this -> processNonExportResult ( $ apiToken ) ; $ connection = clone $ this -> connection ; $ errorHandler = clone $ this -> errorHandler ; $ projectConstructorCallback = $ this -> projectConstructorCallback ; $ project = call_user_func ( $ projectConstructorCallback , $ apiUrl = null , $ apiToken , $ sslVerify = null , $ caCertificateFile = null , $ errorHandler , $ connection ) ; return $ project ; }
Creates a REDCap project with the specified data.

The data fields that can be set are as follows:
<ul>
<li>
<b>project_title</b> - the title of the project.
</li>
<li>
<b>purpose</b> - the purpose of the project:
<ul>
<li>0 - Practice/Just for fun</li>
<li>1 - Other</li>
<li>2 - Research</li>
<li>3 - Quality Improvement</li>
<li>4 - Operational Support</li>
</ul>
</li>
<li>
<b>purpose_other</b> - text descibing purpose if purpose above is specified as 1.
</li>
<li>
<b>project_notes</b> - notes about the project.
</li>
<li>
<b>is_longitudinal</b> - indicates if the project is longitudinal (0 = False [default],
1 = True).
</li>
<li>
<b>surveys_enabled</b> - indicates if surveys are enabled (0 = False [default], 1 = True).
</li>
<li>
<b>record_autonumbering_enabled</b> - indicates id record autonumbering is enabled
(0 = False [default], 1 = True).
</li>
</ul>

@param mixed $projectData the data used for project creation. Note that if
'php' format is used, the data needs to be an array where the keys are
the field names and the values are the field values.
@param $format string the format used to export the arm data.
<ul>
<li> 'php' - [default] array of maps of values</li>
<li> 'csv' - string of CSV (comma-separated values)</li>
<li> 'json' - string of JSON encoded values</li>
<li> 'xml' - string of XML encoded data</li>
</ul>
@param string $odm
@return RedCapProject the project that was created.
Creates a REDCap project with the specified data .