|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Copyright 2013 CPI Group, LLC |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * |
| 7 | + * you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +/** |
| 20 | + * Core class for Amazon Finances API. |
| 21 | + * |
| 22 | + * This is the core class for all objects in the Amazon Finance section. |
| 23 | + * It contains no methods in itself other than the constructor. |
| 24 | + */ |
| 25 | +abstract class AmazonFinanceCore extends AmazonCore { |
| 26 | + /** |
| 27 | + * AmazonFinanceCore constructor sets up key information used in all Amazon Finance Core requests |
| 28 | + * |
| 29 | + * This constructor is called when initializing all objects in the Amazon Finance Core. |
| 30 | + * The parameters are passed by the child objects' constructors, which are |
| 31 | + * in turn passed to the AmazonCore constructor. See it for more information |
| 32 | + * on these parameters and common methods. |
| 33 | + * @param string $s [optional] <p>Name for the store you want to use. |
| 34 | + * This parameter is optional if only one store is defined in the config file.</p> |
| 35 | + * @param boolean $mock [optional] <p>This is a flag for enabling Mock Mode. |
| 36 | + * This defaults to <b>FALSE</b>.</p> |
| 37 | + * @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p> |
| 38 | + * @param string $config [optional] <p>An alternate config file to set. Used for testing.</p> |
| 39 | + */ |
| 40 | + public function __construct($s = null, $mock = false, $m = null, $config = null){ |
| 41 | + parent::__construct($s, $mock, $m, $config); |
| 42 | + include($this->env); |
| 43 | + |
| 44 | + if(isset($AMAZON_VERSION_FINANCE)){ |
| 45 | + $this->urlbranch = 'Finances/'.$AMAZON_VERSION_FINANCE; |
| 46 | + $this->options['Version'] = $AMAZON_VERSION_FINANCE; |
| 47 | + } |
| 48 | + |
| 49 | + if(isset($THROTTLE_LIMIT_FINANCE)) { |
| 50 | + $this->throttleLimit = $THROTTLE_LIMIT_FINANCE; |
| 51 | + } |
| 52 | + if(isset($THROTTLE_TIME_FINANCE)) { |
| 53 | + $this->throttleTime = $THROTTLE_TIME_FINANCE; |
| 54 | + } |
| 55 | + $this->throttleGroup = 'Finance'; |
| 56 | + } |
| 57 | +} |
0 commit comments