Refactor code structure for improved readability and maintainability
1539
.vscode/ftp-kr.sync.cache.json
vendored
BIN
modules/empikmarketplace/.DS_Store
vendored
Normal file
BIN
modules/empikmarketplace/src/Cache/~syncthing~Cache.php.tmp
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Empik\Marketplace\Repository;
|
||||||
|
|
||||||
|
use Db;
|
||||||
|
use DbQuery;
|
||||||
|
use Empik\Marketplace\Utils\Utils;
|
||||||
|
|
||||||
|
class AttributeRepository
|
||||||
|
{
|
||||||
|
/** @var Db */
|
||||||
|
protected $db;
|
||||||
|
|
||||||
|
/** @var int */
|
||||||
|
protected $langId;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->db = Db::getInstance();
|
||||||
|
$this->langId = Utils::getLangId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAttributes($productId, $productAttributeId)
|
||||||
|
{
|
||||||
|
$sql = new DbQuery();
|
||||||
|
$sql->select('al.name AS value, agl.public_name AS name');
|
||||||
|
$sql->from('attribute_group', 'ag');
|
||||||
|
$sql->leftJoin('attribute_group_lang', 'agl', 'agl.id_attribute_group = ag.id_attribute_group AND agl.id_lang = ' . (int)$this->langId);
|
||||||
|
$sql->leftJoin('product_attribute', 'pa', 'pa.id_product = ' . (int)$productId . ' AND pa.id_product_attribute = ' . (int)$productAttributeId);
|
||||||
|
$sql->leftJoin('product_attribute_combination', 'pac', 'pac.id_product_attribute = pa.id_product_attribute');
|
||||||
|
$sql->leftJoin('attribute', 'a', 'a.id_attribute = pac.id_attribute AND ag.id_attribute_group = a.id_attribute_group');
|
||||||
|
$sql->leftJoin('attribute_lang', 'al', 'al.id_attribute = a.id_attribute AND al.id_lang = ' . (int)$this->langId);
|
||||||
|
$sql->orderBy('ag.id_attribute_group');
|
||||||
|
|
||||||
|
$result = $this->db->executeS($sql);
|
||||||
|
|
||||||
|
$resultGrouped = [];
|
||||||
|
foreach ($result as $item) {
|
||||||
|
if (!isset($resultGrouped[$item['name']]) || $item['value']) {
|
||||||
|
$resultGrouped[$item['name']] = $item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (array)$resultGrouped;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
c:\visual studio code\projekty\drmaterac.pl\modules\empikmarketplace\vendor\composer\installers\src\Composer\Installers\~syncthing~CakePHPInstaller.php.tmp
|
||||||
1
modules/empikmarketplace/vendor/symfony/config/Tests/Definition/~syncthing~MergeTest.php.tmp
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
c:\visual studio code\projekty\drmaterac.pl\modules\empikmarketplace\vendor\symfony\config\Tests\Definition\~syncthing~MergeTest.php.tmp
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
c:\visual studio code\projekty\drmaterac.pl\modules\empikmarketplace\vendor\symfony\dependency-injection\Tests\Compiler\~syncthing~CheckDefinitionValidityPassTest.php.tmp
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\OtherDir\Component2\Dir1;
|
||||||
|
|
||||||
|
class Service4
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||||
|
|
||||||
|
use App\BarService;
|
||||||
|
|
||||||
|
return function (ContainerConfigurator $c) {
|
||||||
|
$c->services()
|
||||||
|
->set('bar', 'Class1')
|
||||||
|
->set(BarService::class)
|
||||||
|
->abstract(true)
|
||||||
|
->lazy()
|
||||||
|
->set('foo')
|
||||||
|
->parent(BarService::class)
|
||||||
|
->decorate('bar', 'b', 1)
|
||||||
|
->args([ref('b')])
|
||||||
|
->class('Class2')
|
||||||
|
->file('file.php')
|
||||||
|
->parent('bar')
|
||||||
|
->parent(BarService::class)
|
||||||
|
;
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
c:\visual studio code\projekty\drmaterac.pl\modules\empikmarketplace\vendor\symfony\dependency-injection\Tests\Fixtures\xml\~syncthing~services_deprecated.xml.tmp
|
||||||
BIN
modules/empikmarketplace/views/.DS_Store
vendored
Normal file
BIN
modules/empikmarketplace/views/templates/.DS_Store
vendored
Normal file
BIN
modules/empikmarketplace/views/templates/admin/.DS_Store
vendored
Normal file
|
After Width: | Height: | Size: 242 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 505 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 52 KiB |