Version 1
[yaffs-website] / vendor / gabordemooij / redbean / RedBeanPHP / Cursor / NullCursor.php
diff --git a/vendor/gabordemooij/redbean/RedBeanPHP/Cursor/NullCursor.php b/vendor/gabordemooij/redbean/RedBeanPHP/Cursor/NullCursor.php
new file mode 100644 (file)
index 0000000..5484645
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace RedBeanPHP\Cursor;
+
+use RedBeanPHP\Cursor as Cursor;
+
+/**
+ * NULL Database Cursor
+ * Implementation of the NULL Cursor.
+ * Used for an empty BeanCollection. This Cursor
+ * can be used for instance if a query fails but the interface
+ * demands a cursor to be returned.
+ *
+ * @file    RedBeanPHP/Cursor/NULLCursor.php
+ * @author  Gabor de Mooij and the RedBeanPHP Community
+ * @license BSD/GPLv2
+ *
+ * @copyright
+ * (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
+ * This source file is subject to the BSD/GPLv2 License that is bundled
+ * with this source code in the file license.txt.
+ */
+class NullCursor implements Cursor
+{
+       /**
+        * @see Cursor::getNextItem
+        */
+       public function getNextItem()
+       {
+               return NULL;
+       }
+
+       /**
+        * @see Cursor::close
+        */
+       public function close()
+       {
+               return NULL;
+       }
+}