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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user