22 lines
396 B
PHP
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;
|
|
}
|
|
}
|