Skip to content

Commit

Permalink
Compatibility with contao-onoffice-api-bundle version 3.0 established.
Browse files Browse the repository at this point in the history
  • Loading branch information
doishub committed May 9, 2022
1 parent bbdcd6b commit 3c01134
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"php":"^7.4 || ^8.0",
"contao/core-bundle":"^4.9",
"contao-estatemanager/core": "^1.0",
"oveleon/contao-onoffice-api-bundle": "^2.0"
"oveleon/contao-onoffice-api-bundle": "^3.0"
},
"require-dev": {
"contao/manager-plugin": "^2.0",
Expand Down
6 changes: 3 additions & 3 deletions src/Import/ObjectTypeImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

use Contao\Database;
use ContaoEstateManager\ObjectTypeEntity\ObjectTypeModel;
use Oveleon\ContaoOnofficeApiBundle\OnOfficeRead;
use Oveleon\ContaoOnofficeApiBundle\Controller\ReadController;

class ObjectTypeImport
{
private OnOfficeRead $onOfficeHandler;
private ReadController $onOfficeHandler;

private int $intCount = 0;

Expand All @@ -29,7 +29,7 @@ class ObjectTypeImport
*/
public function __construct()
{
$this->onOfficeHandler = new OnOfficeRead();
$this->onOfficeHandler = new ReadController();
}

/**
Expand Down
14 changes: 10 additions & 4 deletions src/Import/RegionImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

use Contao\Database;
use ContaoEstateManager\RegionEntity\RegionModel;
use Oveleon\ContaoOnofficeApiBundle\OnOfficeRead;
use Oveleon\ContaoOnofficeApiBundle\Controller\ReadController;

class RegionImport
{
private OnOfficeRead $onOfficeHandler;
private ReadController $onOfficeHandler;

private int $intCount = 0;

Expand All @@ -29,15 +29,21 @@ class RegionImport
*/
public function __construct()
{
$this->onOfficeHandler = new OnOfficeRead();
$this->onOfficeHandler = new ReadController();
}

/**
* Fetch all regions and prepare database.
*/
public function fetch(?array $attributes = null): array
{
$arrData = $this->onOfficeHandler->run('regions', null, null, $attributes, true);
$arrData = $this->onOfficeHandler->run(
'regions',
null,
null,
$attributes,
true
);

return [
'message' => 'Please wait, the data will be imported',
Expand Down
6 changes: 3 additions & 3 deletions src/Import/SearchCriteriaImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
use ContaoEstateManager\RegionEntity\Region;
use ContaoEstateManager\RegionEntity\RegionConnectionModel;
use ContaoEstateManager\RegionEntity\RegionModel;
use Oveleon\ContaoOnofficeApiBundle\OnOfficeRead;
use Oveleon\ContaoOnofficeApiBundle\Controller\ReadController;

class SearchCriteriaImport
{
/**
* onOffice Handler.
*/
private OnOfficeRead $onOfficeHandler;
private ReadController $onOfficeHandler;

/**
* Search criteria mapper.
Expand All @@ -54,7 +54,7 @@ public function __construct()
$this->mapper = new SearchCriteriaMapper();

// Create onOffice handler
$this->onOfficeHandler = new OnOfficeRead();
$this->onOfficeHandler = new ReadController();
}

/**
Expand Down

0 comments on commit 3c01134

Please sign in to comment.