forked from kg-bot/laravel-magento
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* @copyright © 2019 Dxvn, Inc. | ||
* | ||
* @author Tran Ngoc Duc <ductn@diepxuan.com> | ||
* @author Tran Ngoc Duc <caothu91@gmail.com> | ||
* | ||
* @lastupdate 2024-07-25 21:20:56 | ||
*/ | ||
|
||
namespace Diepxuan\Magento\Builders; | ||
|
||
use Diepxuan\Magento\Models\StoreViews; | ||
use Illuminate\Support\Collection; | ||
|
||
class StoreViewsBuilder extends Builder | ||
{ | ||
protected $entity = StoreViews::ENTITY; | ||
protected $model = StoreViews::class; | ||
|
||
protected function parseResponse($response): Collection | ||
{ | ||
$fetchedItems = collect($response); | ||
$items = collect([]); | ||
|
||
foreach ($fetchedItems as $index => $item) { | ||
/** @var StoreViews $model */ | ||
$model = new $this->model($this->request, $item); | ||
|
||
$items->push($model); | ||
} | ||
|
||
return $items; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* @copyright © 2019 Dxvn, Inc. | ||
* | ||
* @author Tran Ngoc Duc <ductn@diepxuan.com> | ||
* @author Tran Ngoc Duc <caothu91@gmail.com> | ||
* | ||
* @lastupdate 2024-07-25 21:19:12 | ||
*/ | ||
|
||
namespace Diepxuan\Magento\Models; | ||
|
||
#[\AllowDynamicProperties] | ||
class StoreViews extends Model | ||
{ | ||
public const ENTITY = 'store/storeViews'; | ||
protected $entity = 'store/storeViews'; | ||
protected $primaryKey = 'id'; | ||
} |