Author: jablko
Date: Mon Oct 18 14:35:33 2010
New Revision: 8241

Log:
Add slug to relations

Modified:
   trunk/lib/model/QubitRelation.php

Modified: trunk/lib/model/QubitRelation.php
==============================================================================
--- trunk/lib/model/QubitRelation.php   Mon Oct 18 14:19:37 2010        (r8240)
+++ trunk/lib/model/QubitRelation.php   Mon Oct 18 14:35:33 2010        (r8241)
@@ -29,7 +29,8 @@
  */
 class QubitRelation extends BaseRelation
 {
-  protected $indexOnSave = true;
+  protected
+    $indexOnSave = true;
 
   /**
    * Additional save functionality (e.g. update search index)
@@ -39,10 +40,10 @@
    */
   public function save($connection = null)
   {
-    // TODO: $cleanObject = $this->object->clean;
+    // TODO $cleanObject = $this->object->clean;
     $cleanObjectId = $this->__get('objectId', array('clean' => true));
 
-    // TODO: $cleanSubject = $this->subject->clean;
+    // TODO $cleanSubject = $this->subject->clean;
     $cleanSubjectId = $this->__get('subjectId', array('clean' => true));
 
     parent::save($connection);
@@ -73,6 +74,15 @@
     return $this;
   }
 
+  protected function insert($connection = null)
+  {
+    parent::insert($connection);
+
+    QubitSlug::staticInsert($this->id, null, $connection);
+
+    return $this;
+  }
+
   /**
    * Flag whether to update the search index when saving this object
    *

-- 
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