Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to set ReportOptions for requesting custom reports #173

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions includes/classes/AmazonReportRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,24 @@ public function resetTimeLimits(){
unset($this->options['StartDate']);
unset($this->options['EndDate']);
}

/**
* Sets ReportOptions (Optional)
*
* Use this function to add ReportOptions (for example: custom = true)
* @param string $option <p>ReportOption</p>
* @param string|boolean $value <p>"true" or "false", or boolean</p>
* @return boolean <b>FALSE</b> if improper input
*/
public function setReportOptions($option, $value){
if ($value == 'true' || (is_bool($value) && $value == true)){
$this->options['ReportOptions'] = $option.'=true';
} else if ($value == 'false' || (is_bool($value) && $value == false)){
$this->options['ReportOptions'] = $option.'=false';
} else {
return false;
}
}

/**
* Sets whether or not the report should return the Sales Channel column. (Optional)
Expand Down