calc/src/Model/PartCollection.php
2025-07-08 11:16:53 +02:00

22 lines
396 B
PHP

<?php
namespace PSC\Library\Calc\Model;
use PSC\Library\Calc\Model\Part;
class PartCollection extends \ArrayIterator
{
public function getPartByName($string): Part|null
{
while ($this->valid()) {
if ($string == $this->current()->getName()) {
return $this->current();
}
$this->next();
}
return null;
}
}