PluginProbe
User Access Manager / 2.2.3
User Access Manager v2.2.3
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/Controller/Backend/UserObjectController.php +41 -4 2.3.132.2.3 View file →
@@ -1,5 +1,18 @@
1 1 <?php
2 +/**
3 + * UserObjectController.php
4 + *
5 + * The UserObjectController class file.
6 + *
7 + * PHP versions 5
8 + *
9 + * @author Alexander Schneider <alexanderschneider85@gmail.com>
10 + * @copyright 2008-2017 Alexander Schneider
11 + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
12 + * @version SVN: $id$
13 + * @link http://wordpress.org/extend/plugins/user-access-manager/
14 + */
2 15
3 16 declare(strict_types=1);
4 17
5 18 namespace UserAccessManager\Controller\Backend;
@@ -6,10 +19,20 @@
6 19
7 20 use UserAccessManager\Object\ObjectHandler;
8 21 use UserAccessManager\UserGroup\UserGroupTypeException;
9 22
23 +/**
24 + * Class UserObjectController
25 + *
26 + * @package UserAccessManager\Controller\Backend
27 + */
10 28 class UserObjectController extends ObjectController
11 29 {
30 + /**
31 + * The function for the manage_users_columns filter.
32 + * @param array $defaults The table headers.
33 + * @return array
34 + */
12 35 public function addUserColumnsHeader(array $defaults): array
13 36 {
14 37 $defaults[self::COLUMN_NAME] = TXT_UAM_COLUMN_USER_GROUPS;
15 38 return $defaults;
@@ -15,11 +38,17 @@
15 38 return $defaults;
16 39 }
17 40
18 41 /**
42 + * The function for the manage_users_custom_column action.
43 + * @param string $return The normal return value.
44 + * @param string $columnName The column name.
45 + * @param integer $id The id.
46 + * @return string|null
19 47 * @throws UserGroupTypeException
48 + * @throws UserGroupTypeException
20 49 */
21 - public function addUserColumn(?string $return, string $columnName, int|string|null $id): ?string
50 + public function addUserColumn(string $return, string $columnName, int $id): ?string
22 51 {
23 52 if ($columnName === self::COLUMN_NAME) {
24 53 $this->setObjectInformation(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $id);
25 54 $return .= $this->getIncludeContents('UserColumn.php');
@@ -28,11 +57,12 @@
28 57 return $return;
29 58 }
30 59
31 60 /**
61 + * The function for the edit_user_profile action.
32 62 * @throws UserGroupTypeException
33 63 */
34 - public function showUserProfile(): void
64 + public function showUserProfile()
35 65 {
36 66 $userId = $this->getRequestParameter('user_id');
37 67 $this->setObjectInformation(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
38 68
@@ -39,16 +69,23 @@
39 69 echo $this->getIncludeContents('UserProfileEditForm.php');
40 70 }
41 71
42 72 /**
73 + * The function for the profile_update action.
74 + * @param integer $userId The user id.
43 75 * @throws UserGroupTypeException
76 + * @throws UserGroupTypeException
44 77 */
45 - public function saveUserData(int|string|null $userId): void
78 + public function saveUserData(int $userId)
46 79 {
47 80 $this->saveObjectData(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
48 81 }
49 82
50 - public function removeUserData(int|string|null $userId): void
83 + /**
84 + * The function for the delete_user action.
85 + * @param integer $userId The user id.
86 + */
87 + public function removeUserData(int $userId)
51 88 {
52 89 $this->removeObjectData(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
53 90 }
54 91 }