Initial commit
This commit is contained in:
53
www/client/plugins/tinymceplus/Loop/ExternalName.php
Normal file
53
www/client/plugins/tinymceplus/Loop/ExternalName.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user