Author: sevein
Date: Mon Jul 25 14:23:19 2011
New Revision: 9379

Log:
Add license and toString magic method

Modified:
   trunk/lib/model/QubitRights.php
   trunk/lib/model/QubitRightsI18n.php

Modified: trunk/lib/model/QubitRights.php
==============================================================================
--- trunk/lib/model/QubitRights.php     Mon Jul 25 14:21:53 2011        (r9378)
+++ trunk/lib/model/QubitRights.php     Mon Jul 25 14:23:19 2011        (r9379)
@@ -21,7 +21,26 @@
 {
   public function __toString()
   {
-    return (string) $this->act;
+    $string = array();
+    
+    if (isset($this->basis))
+    {
+      $string[] = $this->basis;
+    }
+    
+    if (isset($this->act))
+    {
+      $string[] = $this->act;
+    }
+
+    $string = implode(' - ', $string);
+
+    if (null !== $date = Qubit::renderDateStartEnd(null, $this->startDate, 
$this->endDate))
+    {
+      $string .= ' ('.$date.')';
+    }
+
+    return $string;
   }
 
   protected function insert($connection = null)

Modified: trunk/lib/model/QubitRightsI18n.php
==============================================================================
--- trunk/lib/model/QubitRightsI18n.php Mon Jul 25 14:21:53 2011        (r9378)
+++ trunk/lib/model/QubitRightsI18n.php Mon Jul 25 14:23:19 2011        (r9379)
@@ -1,17 +1,22 @@
 <?php
 
-
-/**
- * Skeleton subclass for representing a row from the 'rights_i18n' table.
+/*
+ * This file is part of Qubit Toolkit.
  *
- * 
+ * Qubit Toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * You should add additional methods to this class to meet the
- * application requirements.  This class will only be generated as
- * long as it does not already exist in the output directory.
+ * Qubit Toolkit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * @package    lib.model
+ * You should have received a copy of the GNU General Public License
+ * along with Qubit Toolkit.  If not, see <http://www.gnu.org/licenses/>.
  */
+
 class QubitRightsI18n extends BaseRightsI18n {
 
-} // QubitRightsI18n
+}

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to