Skip to content
Code-Schnipsel Gruppen Projekte
Commit 64db8d43 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next' into 'master'

Next

See merge request !42
Übergeordnete 08125519 1d6ffb78
No related branches found
Tags 1.9.0
2 Merge Requests!140Update 'next-4.x' with latest changes from 'main',!42Next
Pipeline #4922 bestanden mit Phase
in 30 Sekunden
......@@ -49,9 +49,9 @@ class ArticleListUnique implements IteratorAggregate
/**
* PriceFactor List
*
* @var QUI\ERP\Accounting\PriceFactors\FactorList
* @var ErpFactorList
*/
protected $PriceFactors = false;
protected ErpFactorList $PriceFactors;
/**
* @var null|QUI\Locale
......@@ -509,9 +509,9 @@ public function renderForMail(): string
/**
* Return the price factors list (list of price indicators)
*
* @return QUI\ERP\Accounting\PriceFactors\FactorList
* @return ErpFactorList
*/
public function getPriceFactors()
public function getPriceFactors(): ErpFactorList
{
return $this->PriceFactors;
}
......
......@@ -13,6 +13,7 @@
use Traversable;
use function array_map;
use function array_values;
use function count;
use function is_array;
use function json_encode;
......@@ -32,7 +33,7 @@ class FactorList implements IteratorAggregate, Countable
*
* @var Factor[]
*/
protected array $list = [];
protected array $factorList = [];
/**
* FactorList constructor.
......@@ -49,11 +50,11 @@ public function __construct(array $data = [])
foreach ($data as $factorData) {
if ($factorData instanceof Factor) {
$this->list[] = $factorData;
$this->factorList[] = $factorData;
continue;
}
$this->list[] = new Factor($factorData);
$this->factorList[] = new Factor($factorData);
}
}
......@@ -64,7 +65,7 @@ public function __construct(array $data = [])
*/
public function count(): int
{
return count($this->list);
return count($this->factorList);
}
/**
......@@ -77,7 +78,7 @@ public function toArray(): array
return array_map(function ($Factor) {
/* @var $Factor Factor */
return $Factor->toArray();
}, $this->list);
}, $this->factorList);
}
/**
......@@ -96,7 +97,7 @@ public function toJSON(): string
*/
public function addFactor(Factor $Factor)
{
$this->list[] = $Factor;
$this->factorList[] = $Factor;
}
/**
......@@ -106,8 +107,16 @@ public function addFactor(Factor $Factor)
*/
public function setFactor(int $index, QUI\ERP\Accounting\PriceFactors\Factor $Factor)
{
if (isset($this->list[$index])) {
$this->list[$index] = $Factor;
if (isset($this->factorList[$index])) {
$this->factorList[$index] = $Factor;
}
}
public function removeFactor(int $index)
{
if (isset($this->factorList[$index])) {
unset($this->factorList[$index]);
$this->factorList = array_values($this->factorList);
}
}
......@@ -117,8 +126,8 @@ public function setFactor(int $index, QUI\ERP\Accounting\PriceFactors\Factor $Fa
*/
public function getFactor(int $index): ?Factor
{
if (isset($this->list[$index])) {
return $this->list[$index];
if (isset($this->factorList[$index])) {
return $this->factorList[$index];
}
return null;
......@@ -133,7 +142,7 @@ public function getFactor(int $index): ?Factor
*/
public function getIterator(): \Traversable
{
return new ArrayIterator($this->list);
return new ArrayIterator($this->factorList);
}
//endregion
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren