scalarOnly = $scalarOnly; $this->dynamicAssignment = $dynamicAssignment; parent::__construct($name); } /** * If the field value and $dynamicAssignment are true, we'll try to do a dynamic assignment. */ public function prepValueForDB(mixed $value): array|int|null { if ($value) { return $this->dynamicAssignment ? ['ABS(?)' => [1]] : 1; } return 0; } public function scalarValueOnly(): bool { return $this->scalarOnly; } }