From a33e2b89c8d1f4997b4bf423951eef50ee0c4a3d Mon Sep 17 00:00:00 2001 From: doctrine Date: Sat, 22 Jul 2006 06:39:46 +0000 Subject: [PATCH] [amadeus] Changed getFirst to use reset function for proper behavior on empty --- Doctrine/Collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doctrine/Collection.php b/Doctrine/Collection.php index 85a0da302..fd2401127 100644 --- a/Doctrine/Collection.php +++ b/Doctrine/Collection.php @@ -157,7 +157,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @return mixed */ public function getFirst() { - return $this->data[0]; + return reset($this->data); } /** * @return mixed