public function extractValue($values) { if (!$this->collection) { if (count($values) > 1) { throw new DbException("Expected one result for {$this->name}"); } return Arrays::firstOrNull($values); } return $values; }