fix: only use destination's pickup values
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\BusProNet\Model\Pickup;
|
||||
use App\Entity\Traits\SoftDeletableEntity;
|
||||
use App\Entity\Traits\TimestampableEntity;
|
||||
use App\Repository\DestinationRepository;
|
||||
@@ -171,6 +172,17 @@ class Destination implements TimestampableEntityInterface, SoftDeletableEntityIn
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPickup(int $id): ?Pickup
|
||||
{
|
||||
foreach ($this->getPickups() as $pickup) {
|
||||
if ($id === $pickup['busProId']) {
|
||||
return Pickup::fromArray($pickup);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function hasBusTransfer(): bool
|
||||
{
|
||||
return 0 < count($this->getPickups());
|
||||
|
||||
@@ -43,7 +43,7 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
|
||||
private ?Teamer $teamer;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $pickup = null;
|
||||
private ?int $pickup;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $remarks;
|
||||
|
||||
Reference in New Issue
Block a user