This repository has been archived on 2023-12-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ae75/www/client/plugins/tinymceplus/Loop/ExternalName.php
2020-11-02 15:46:52 +01:00

53 lines
1.1 KiB
PHP

<?php
/**
* User: Yohann Genre
* Date: 30/10/2015
* Time: 13:04
*
*/
namespace AdvancePrices\Loop;
use Thelia\Core\Template\Element\ArraySearchLoopInterface;
use Thelia\Core\Template\Element\BaseLoop;
use AdvancePrices\WebService\USSProduct;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
class ExternalName extends BaseLoop implements ArraySearchLoopInterface
{
/**
* @return ArgumentCollection
*/
protected function getArgDefinitions()
{
return new ArgumentCollection(
);
}
public function buildArray()
{
$ws = new USSProduct();
return $ws->getProductList();
}
public function parseResults(LoopResult $loopResult)
{
foreach ($loopResult->getResultDataCollection() as $product) {
$loopResultRow = new LoopResultRow();
$loopResultRow->set("NAME", $product->name)
->set("LABEL", utf8_decode($product->label));
$loopResult->addRow($loopResultRow);
}
return $loopResult;
}
}