/** * Fetch and return the first column of this query's first row * * @return mixed|false False in case of no result */ public function fetchOne() { if (!$this->hasOrder()) { $this->order(); } $result = $this->query->fetchOne(); if ($result !== false && $this->repository->providesValueConversion($this->target)) { $columns = $this->getColumns(); $column = isset($columns[0]) ? $columns[0] : key($columns); return $this->repository->retrieveColumn($this->target, $column, $result, $this); } return $result; }