[!!!][~API] Extbase (Persistence): $query->execute() now returns a plain array of...
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Value.php
index 38ad077..797ea06 100644 (file)
@@ -31,7 +31,7 @@
  *
  * @package Extbase
  * @subpackage Persistence
- * @version $Id: Value.php 2191 2009-05-07 19:49:06Z k-fish $
+ * @version $Id$
  * @scope prototype
  */
 class Tx_Extbase_Persistence_Value implements Tx_Extbase_Persistence_ValueInterface {
@@ -66,6 +66,11 @@ class Tx_Extbase_Persistence_Value implements Tx_Extbase_Persistence_ValueInterf
         */
        public function getString() {
                if ($this->value === NULL) return NULL;
+               if (is_array($this->value)) return $this->value;
+               if ($this->value instanceof Tx_Extbase_DomainObject_AbstractDomainObject) {
+                       return (string)$this->value->getUid();
+               }
+
                switch ($this->type) {
                        case Tx_Extbase_Persistence_PropertyType::DATE:
                                if (is_a($this->value, 'DateTime')) {