Loading cmlapi.info.yml +1 −4 Original line number Diff line number Diff line name: CML API description: Commerce ML API type: module core: 8.x core_version_requirement: ^8 || ^9 core_version_requirement: ^9 || ^10 package: cml dependencies: - drupal:system (>=8.4) src/Controller/Catalog.php +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ namespace Drupal\cmlapi\Controller; use Drupal\Core\Controller\ControllerBase; /** * Catalog route. * Catalog Page. */ class Catalog extends ControllerBase { Loading src/Controller/Product.php +3 −3 Original line number Diff line number Diff line Loading @@ -81,18 +81,18 @@ class Product extends ControllerBase { 'tip' => [ '#theme' => 'item_list', '#title' => 'ТипНоменклатуры', '#items' => $tips, '#items' => $tips ?? [], ], 'vid' => [ '#theme' => 'item_list', '#title' => 'ВидНоменклатуры', '#items' => $vids, '#items' => $vids ?? [], '#list_type' => 'ol', ], 'izgotovitel' => [ '#theme' => 'item_list', '#title' => 'Изготовитель', '#items' => $izgotovitels, '#items' => $izgotovitels ?? [], ], 'pre' => ['#markup' => $result], ]; Loading src/Controller/ProductVariation.php +6 −3 Original line number Diff line number Diff line Loading @@ -21,13 +21,16 @@ class ProductVariation extends ControllerBase { if ($data) { $feature = Yaml::dump($this->prepareFeature($data['feature']), 5); $offer = Yaml::dump($this->prepareOffer($data['offer'], $data['feature']), 7, 1, FALSE, TRUE); } return [ 'feature' => ['#markup' => "<pre>$feature</pre>"], 'category' => ['#markup' => "<pre>$offer</pre>"], ]; } return [ '#markup' => $this->t('No data'), ]; } /** * Json import. Loading src/Service/ParserBase.php +18 −4 Original line number Diff line number Diff line Loading @@ -5,19 +5,33 @@ namespace Drupal\cmlapi\Service; use Symfony\Component\Yaml\Yaml; /** * Class ParserBase. * Abstract? Parser \Base Class. */ class ParserBase { /** * The cml service. * * @var \Drupal\cmlapi\Service\CmlService */ protected $cmlService; /** * XML parser. * * @var \Drupal\cmlapi\Service\XmlParser */ protected $xmlParserService; /** * Constructs a new ParserBase object. * * @param \Drupal\cmlapi\Service\CmlServiceInterface $cml * @param \Drupal\cmlapi\Service\CmlService $cml * The alias cleaner. * @param \Drupal\cmlapi\Service\XmlParserInterface $xml_parser * @param \Drupal\cmlapi\Service\XmlParser $xml_parser * The alias storage helper. */ public function __construct(CmlServiceInterface $cml, XmlParserInterface $xml_parser) { public function __construct(CmlService $cml, XmlParser $xml_parser) { $this->cmlService = $cml; $this->xmlParserService = $xml_parser; } Loading Loading
cmlapi.info.yml +1 −4 Original line number Diff line number Diff line name: CML API description: Commerce ML API type: module core: 8.x core_version_requirement: ^8 || ^9 core_version_requirement: ^9 || ^10 package: cml dependencies: - drupal:system (>=8.4)
src/Controller/Catalog.php +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ namespace Drupal\cmlapi\Controller; use Drupal\Core\Controller\ControllerBase; /** * Catalog route. * Catalog Page. */ class Catalog extends ControllerBase { Loading
src/Controller/Product.php +3 −3 Original line number Diff line number Diff line Loading @@ -81,18 +81,18 @@ class Product extends ControllerBase { 'tip' => [ '#theme' => 'item_list', '#title' => 'ТипНоменклатуры', '#items' => $tips, '#items' => $tips ?? [], ], 'vid' => [ '#theme' => 'item_list', '#title' => 'ВидНоменклатуры', '#items' => $vids, '#items' => $vids ?? [], '#list_type' => 'ol', ], 'izgotovitel' => [ '#theme' => 'item_list', '#title' => 'Изготовитель', '#items' => $izgotovitels, '#items' => $izgotovitels ?? [], ], 'pre' => ['#markup' => $result], ]; Loading
src/Controller/ProductVariation.php +6 −3 Original line number Diff line number Diff line Loading @@ -21,13 +21,16 @@ class ProductVariation extends ControllerBase { if ($data) { $feature = Yaml::dump($this->prepareFeature($data['feature']), 5); $offer = Yaml::dump($this->prepareOffer($data['offer'], $data['feature']), 7, 1, FALSE, TRUE); } return [ 'feature' => ['#markup' => "<pre>$feature</pre>"], 'category' => ['#markup' => "<pre>$offer</pre>"], ]; } return [ '#markup' => $this->t('No data'), ]; } /** * Json import. Loading
src/Service/ParserBase.php +18 −4 Original line number Diff line number Diff line Loading @@ -5,19 +5,33 @@ namespace Drupal\cmlapi\Service; use Symfony\Component\Yaml\Yaml; /** * Class ParserBase. * Abstract? Parser \Base Class. */ class ParserBase { /** * The cml service. * * @var \Drupal\cmlapi\Service\CmlService */ protected $cmlService; /** * XML parser. * * @var \Drupal\cmlapi\Service\XmlParser */ protected $xmlParserService; /** * Constructs a new ParserBase object. * * @param \Drupal\cmlapi\Service\CmlServiceInterface $cml * @param \Drupal\cmlapi\Service\CmlService $cml * The alias cleaner. * @param \Drupal\cmlapi\Service\XmlParserInterface $xml_parser * @param \Drupal\cmlapi\Service\XmlParser $xml_parser * The alias storage helper. */ public function __construct(CmlServiceInterface $cml, XmlParserInterface $xml_parser) { public function __construct(CmlService $cml, XmlParser $xml_parser) { $this->cmlService = $cml; $this->xmlParserService = $xml_parser; } Loading