Giter Site home page Giter Site logo

phpcap's People

Contributors

aarenson avatar mullen2 avatar naalong avatar wibeasley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

phpcap's Issues

Update Specific Record value

Dear Developers,

Thank you for putting effort into developing phpcap library.

I was wondering what wold be the best way to update specific field in specific record?

Is there ant straightforward way to achieve this?

For example:

# Print the first and last names for all records
$records = $project->exportRecords();
foreach ($records as $record) {
    print $record['first_name']." ".$record['last_name']."\n";
    // Something maybe in such way
    $project->updateRecord($record, "field_id", "new_value");
}

Thanks!

Deprecation warning on PHP 8

Using PHPCap on PHP 8 generates a deprecation warning because $apiUrl is not defined as a class member in the RedCapProject class.

"PHP Deprecated: Creation of dynamic property IU\PHPCap\RedCapProject::$apiUrl is deprecated"

Support for original filename in exportFile

I glanced through the code but do not think it supports a method to pull the original uploaded file information which is hidden at the end of the original REDCap docs:

How to obtain the filename of the file:
The MIME type of the file, along with the name of the file and its extension, can be found in the header of the returned response. Thus in order to determine these attributes of the file being exported, you will need to parse the response header. Example: content-type = application/vnd.openxmlformats-officedocument.wordprocessingml.document; name='FILE_NAME.docx'

Would be great to have an option to obtain that information from the file details during export, maybe exportFileObject which would return an object like:

{
  "content-type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "name": "FILE_NAME.docx',
  "source": "...."
}

Or, I could be missing it if is already exists... Thx.

exportRecords $filterLogic parameter is marked as array type but should probably be a string

Hi,

In the method specification $filterLogic is marked as an array type parameter. Could it be that this should be string?

* @param array $filterLogic logic used to restrict the records retrieved, e.g.,

In exportRecords I see that the method calls processFilterLogicArgument.

$data['filterLogic'] = $this->processFilterLogicArgument($filterLogic);

This on it's turn checks for the parameter to be of type "string".

phpcap/src/RedCapProject.php

Lines 2345 to 2358 in e557781

protected function processFilterLogicArgument($filterLogic)
{
if ($filterLogic == null) {
$filterLogic = '';
} else {
if (gettype($filterLogic) !== 'string') {
$message = 'Invalid type for filterLogic. It should be a string, but has type "'
.gettype($filterLogic).'".';
$code = ErrorHandlerInterface::INVALID_ARGUMENT;
$this->errorHandler->throwException($message, $code);
} // @codeCoverageIgnore
}
return $filterLogic;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.