Add getLaneProducts method to department_selfserve_tasks_o and implement lane product retrieval in related objects and routes; enhance object validation with requireSelected method

This commit is contained in:
Jeppe Bundgaard
2026-01-20 13:19:20 +01:00
parent 67e27f67a4
commit d4ba8b7564
4 changed files with 39 additions and 0 deletions
@@ -28,12 +28,22 @@ class object_property
return $this->value();
}
public function requireSelected(): void
{
// Check if the object is selected
// This is a placeholder function. In a real implementation, this would check if the object
if (!isset($this->id)) {
throw new \RuntimeException("Object not selected");
}
}
/**
* Get the value of the field in the database table
* @return mixed The value of the field in the database table
*/
public function value(): mixed
{
self::requireSelected();
if ($this->id < 0) {
// If the object id is less than 0, return the fake value
return $this->fake_value ?? $this->default;