mirror of
https://github.com/brunofontes/Memsource-API.git
synced 2025-11-17 02:30:54 -03:00
Refactoring base functions
Fetch functions, curl and it's parameters now are all in the FetchApi file, while other Classes will receive them by Dependence Injection
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
namespace BrunoFontes\Memsource;
|
||||
|
||||
class BilingualFile extends \BrunoFontes\Memsource
|
||||
class BilingualFile extends \BrunoFontes\Memsource\BaseApi
|
||||
{
|
||||
private $_url = '/bilingualFiles';
|
||||
|
||||
@@ -35,7 +35,7 @@ class BilingualFile extends \BrunoFontes\Memsource
|
||||
for ($i = 0; $i < count($groupedJobUids); $i++) {
|
||||
$apiReadyArray = $this->_convertUidArrayToApiRequest($groupedJobUids[$i]);
|
||||
$filenames[$i] = count($groupedJobUids) > 1?"{$i}_{$filename}":$filename;
|
||||
$filecontent = $this->fetch('jsonPost', $url, $apiReadyArray);
|
||||
$filecontent = $this->fetchApi->fetch('jsonPost', $url, $apiReadyArray);
|
||||
$this->_saveIntoFile($filenames[$i], $filecontent);
|
||||
}
|
||||
return $filenames;
|
||||
|
||||
Reference in New Issue
Block a user