Ensure that UFC_SchoolId is exportable
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 20 Feb 2011 01:05:24 +0000 (02:05 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 20 Feb 2011 01:05:24 +0000 (02:05 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/userfilter/conditions.inc.php

index 7a2ded5..b782311 100644 (file)
@@ -166,6 +166,12 @@ abstract class UserFilterCondition implements PlFilterCondition
             $cond = new $class($values);
             break;
 
+          case 'school_id':
+            $values = $export->v('values', array());
+            $school_type = $export->s('school_type');
+            $cond = new UFC_SchoolId($school_type, $values);
+            break;
+
           case 'has_profile':
             $class = 'ufc_' . str_replace('_', '', $type);
             $cond = new $class();
@@ -487,6 +493,14 @@ class UFC_SchoolId extends UserFilterCondition
         }
         return XDB::format('p.' . $type . '_id IN {?}', $ids);
     }
+
+    public function export()
+    {
+        $export = $this->buildExport('school_id');
+        $export['school_type'] = $this->type;
+        $export['values'] = $this->ids;
+        return $export;
+    }
 }
 // }}}
 // {{{ class UFC_EducationSchool