public function fillFromExport($export) { $export = new PlDict($export); if (!$export->has('type')) { throw new Exception("Missing 'type' field in export."); } if ($export->s('type') != self::TYPE_UFB) { throw new Exception("Unknown type '{$type}' in export."); } $this->ufc = UserFilterCondition::fromExport($export->v('condition')); $this->env = $export->v('env', array()); }
public static function fromExportedConditions(array $export) { $cond = UserFilterCondition::fromExport($export); return new UserFilter($cond); }