src/db/DB.class.php
public function fetchObject($query, array $values, $instance, $fetchMode = PDO::FETCH_INTO) {
		$obj = null;
		try {
			$statement = $this->pdo->prepare($query);
			$statement->setFetchMode($fetchMode, $instance);
			if ($statement->execute($values)) {
				$obj = $statement->fetch($fetchMode);
				if (!$obj) return null;
			} else {
				$errorInfo = $statement->errorInfo();
				error_log($errorInfo[2]);
			}
		} catch (PDOException $e) {
			error_log($e->getMessage());
		}
		return $obj;
	}
public function fetchObject($query, array $values, $instance, $fetchMode = PDO::FETCH_INTO) {
		$obj = null;
		try {
			$statement = $this->pdo->prepare($query);
			$statement->setFetchMode($fetchMode, $instance);
			if ($statement->execute($values)) {
				$obj = $statement->fetch($fetchMode);
				if (!$obj) return null;
			} else {
				$errorInfo = $statement->errorInfo();
				error_log($errorInfo[2]);
			}
		} catch (PDOException $e) {
			error_log($e->getMessage());
		}
		return $obj;
	}
Set corresponding fields in an object from result set.

@param string $query
@param array $values
@param object $instance - the initialized object that the fields should be set in
@param array $callback [default=array()]
@return object