Example #1
0
 public static function fromExport(array $export)
 {
     $export = new PlDict($export);
     if (!$export->has('conditions')) {
         throw new Exception("Cannot build a user filter without conditions");
     }
     $cond = UserFilterCondition::fromExport($export->v('conditions'));
     $sorts = null;
     if ($export->has('sorts')) {
         $sorts = array();
         foreach ($export->v('sorts') as $sort) {
             $sorts[] = UserFilterOrder::fromExport($sort);
         }
     }
     return new UserFilter($cond, $sorts);
 }
Example #2
0
 public function __construct($type, $desc = false)
 {
     parent::__construct($desc);
     $this->type = $type;
 }