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