always give back project_id as int
This commit is contained in:
parent
5c0315c647
commit
4a738a9067
1 changed files with 7 additions and 5 deletions
|
@ -55,7 +55,7 @@ class TwingleApiCall {
|
||||||
*
|
*
|
||||||
* If $id parameter is given, this function returns a single project.
|
* If $id parameter is given, this function returns a single project.
|
||||||
*
|
*
|
||||||
* @param null $projectId
|
* @param int|null $projectId
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
@ -148,7 +148,7 @@ class TwingleApiCall {
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
return [
|
return [
|
||||||
"title" => $values['name'],
|
"title" => $values['name'],
|
||||||
"project_id" => $values['id'],
|
"project_id" => (int) $values['id'],
|
||||||
"status" =>
|
"status" =>
|
||||||
"Failed to get project options from Twingle: $e->getMessage()",
|
"Failed to get project options from Twingle: $e->getMessage()",
|
||||||
];
|
];
|
||||||
|
@ -179,7 +179,7 @@ class TwingleApiCall {
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
return [
|
return [
|
||||||
"title" => $values['name'],
|
"title" => $values['name'],
|
||||||
"project_id" => $values['id'],
|
"project_id" => (int) $values['id'],
|
||||||
"status" =>
|
"status" =>
|
||||||
"Failed to instantiate TwingleProject: $e->getMessage()",
|
"Failed to instantiate TwingleProject: $e->getMessage()",
|
||||||
];
|
];
|
||||||
|
@ -187,6 +187,7 @@ class TwingleApiCall {
|
||||||
|
|
||||||
// Check if the TwingleProject campaign already exists
|
// Check if the TwingleProject campaign already exists
|
||||||
if (!$project->exists()) {
|
if (!$project->exists()) {
|
||||||
|
|
||||||
// ... if not, create it
|
// ... if not, create it
|
||||||
try {
|
try {
|
||||||
$result = $project->create($is_test);
|
$result = $project->create($is_test);
|
||||||
|
@ -200,7 +201,7 @@ class TwingleApiCall {
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
return [
|
return [
|
||||||
"title" => $values['name'],
|
"title" => $values['name'],
|
||||||
"project_id" => $values['id'],
|
"project_id" => (int) $values['id'],
|
||||||
"status" =>
|
"status" =>
|
||||||
"Could not create campaign from TwingleProject: $e->getMessage()",
|
"Could not create campaign from TwingleProject: $e->getMessage()",
|
||||||
];
|
];
|
||||||
|
@ -331,12 +332,13 @@ class TwingleApiCall {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Does a cURL and gives back the result array.
|
* Does a cURL and gives back the result array.
|
||||||
*
|
*
|
||||||
* @param $url
|
* @param $url
|
||||||
|
* The url the curl should get sent to
|
||||||
*
|
*
|
||||||
* @param null $params
|
* @param null $params
|
||||||
|
* The parameters you want to send (optional)
|
||||||
*
|
*
|
||||||
* @return array|bool
|
* @return array|bool
|
||||||
* Returns the result array of the curl or FALSE, if the curl failed
|
* Returns the result array of the curl or FALSE, if the curl failed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue