Move user content provider migration guide into PHP part
authorMatthias Schmidt <gravatronics@live.com>
Sun, 30 Dec 2018 16:59:10 +0000 (17:59 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 30 Dec 2018 16:59:10 +0000 (17:59 +0100)
_data/sidebars/sidebar.yml
pages/migration/wsc-31/migration_wsc-31_php.md
pages/migration/wsc-31/migration_wsc-31_user-content-providers.md [deleted file]

index e69445e224e2883aa6f93b372ca6495326338807..01f8a72b69672224db4160dc90ca9e52675edd65 100644 (file)
@@ -122,8 +122,6 @@ entries:
 
           - title: PHP API
             url: /migration_wsc-31_php.html
-          - title: User Content Providers
-            url: /migration_wsc-31_user-content-providers.html
 
         - title: Migrating from WSC 3.0
           subfolderitems:
index 373c69c0105b0a9479626359c0407e3495d74093..7ec9fcbdafc90e21b61dfbd745b54d08db94b573 100644 (file)
@@ -12,3 +12,59 @@ WoltLab Suite Core 3.2 introduces a new, simpler and quicker way of creating for
 You can find examples of how to migrate existing forms to form builder [here](migration_wsc-31_form-builder.html).
 
 In the near future, to ensure backwards compatibility within WoltLab packages, we will only use form builder for new forms or for major rewrites of existing forms that would break backwards compatibility anyway.
+
+
+## User Content Providers
+
+User content providers help the WoltLab Suite to find user generated content. They provide a class with which you can find content from a particular user and delete objects.
+
+
+### PHP Class
+
+First, we create the PHP class that provides our interface to provide the data. The class must implement interface `wcf\system\user\content\provider\IUserContentProvider` in any case. Mostly we process data which is based on [`wcf\data\DatabaseObject`](php_database-objects.html). In this case, the WoltLab Suite provides an abstract class `wcf\system\user\content\provider\AbstractDatabaseUserContentProvider` that can be used to automatically generates the standardized classes to generate the list and deletes objects via the DatabaseObjectAction. For example, if we would create a content provider for comments, the class would look like this: 
+
+```php
+<?php
+namespace wcf\system\user\content\provider;
+use wcf\data\comment\Comment;
+
+/**
+ * User content provider for comments.
+ *
+ * @author     Joshua Ruesweg
+ * @copyright  2001-2018 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\System\User\Content\Provider
+ * @since      3.2
+ */
+class CommentUserContentProvider extends AbstractDatabaseUserContentProvider {
+       /**
+        * @inheritdoc
+        */
+       public static function getDatabaseObjectClass() {
+               return Comment::class;
+       }
+}
+```
+
+### Object Type
+
+Now the appropriate object type must be created for the class. This object type must be from the definition `com.woltlab.wcf.content.userContentProvider` and include the previous created class as FQN in the parameter `classname`. Also the following parameters can be used in the object type: 
+
+#### `nicevalue` 
+
+<span class="label label-info">Optional</span>
+
+The nice value is used to determine the order in which the remove content worker are execute the provider. Content provider with lower nice values are executed first.
+
+#### `hidden`
+
+<span class="label label-info">Optional</span>
+
+Specifies whether or not this content provider can be actively selected in the Content Remove Worker. If it cannot be selected, it will not be executed automatically! 
+
+#### `requiredobjecttype`
+
+<span class="label label-info">Optional</span>
+
+The specified list of comma-separated object types are automatically removed during content removal when this object type is being removed. Heads up: The order of removal is undefined by default, specify a `nicevalue` if the order is important.
diff --git a/pages/migration/wsc-31/migration_wsc-31_user-content-providers.md b/pages/migration/wsc-31/migration_wsc-31_user-content-providers.md
deleted file mode 100644 (file)
index 431006e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
----
-title: Migrating from WSC 3.1 - User Content Providers
-sidebar: sidebar
-permalink: migration_wsc-31_user-content-providers.html
-folder: migration/wsc-31
----
-
-User Content Providers help the WoltLab Suite to find user generated content. They provide a class with which you can find content from a particular user and delete objects.
-
-
-## PHP Class
-
-First, we create the PHP class that provides our interface to provide the data. The class must implement interface `wcf\system\user\content\provider\IUserContentProvider` in any case. Mostly we process data which is based on [`wcf\data\DatabaseObject`](php_database-objects.html). In this case, the WoltLab Suite provides an abstract class `wcf\system\user\content\provider\AbstractDatabaseUserContentProvider` that can be used to automatically generates the standardized classes to generate the list and deletes objects via the DatabaseObjectAction. For example, if we would create a content provider for comments, the class would look like this: 
-
-```php
-<?php
-namespace wcf\system\user\content\provider;
-use wcf\data\comment\Comment;
-
-/**
- * User content provider for comments.
- *
- * @author     Joshua Ruesweg
- * @copyright  2001-2018 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    WoltLabSuite\Core\System\User\Content\Provider
- * @since      3.2
- */
-class CommentUserContentProvider extends AbstractDatabaseUserContentProvider {
-       /**
-        * @inheritdoc
-        */
-       public static function getDatabaseObjectClass() {
-               return Comment::class;
-       }
-}
-```
-
-## Object Type
-
-Now the appropriate object type must be created for the class. This object type must be from the definition `com.woltlab.wcf.content.userContentProvider` and include the previous created class as FQN in the parameter `classname`. Also the following parameters can be used in the object type: 
-
-### `nicevalue` 
-
-<span class="label label-info">Optional</span>
-
-The nice value is used to determine the order in which the remove content worker are execute the provider. Content provider with lower nice values are executed first.
-
-### `hidden`
-
-<span class="label label-info">Optional</span>
-
-Specifies whether or not this content provider can be actively selected in the Content Remove Worker. If it cannot be selected, it will not be executed automatically! 
-
-### `requiredobjecttype`
-
-<span class="label label-info">Optional</span>
-
-The specified list of comma-separated object types are automatically removed during content removal when this object type is being removed. Heads up: The order of removal is undefined by default, specify a `nicevalue` if the order is important.
\ No newline at end of file