PluginProbe
User Access Manager / 2.1.1
User Access Manager v2.1.1
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
user-access-manager / src / UserGroup / UserGroupFactory.php

UserGroupFactory.php in User Access Manager 2.1.1, at src/UserGroup/UserGroupFactory.php

139 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * UserGroupFactory.php
4 *
5 * The UserGroupFactory 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 */
15 namespace UserAccessManager\UserGroup;
16
17 use UserAccessManager\Config\MainConfig;
18 use UserAccessManager\Database\Database;
19 use UserAccessManager\Object\ObjectHandler;
20 use UserAccessManager\Util\Util;
21 use UserAccessManager\Wrapper\Php;
22 use UserAccessManager\Wrapper\Wordpress;
23
24 /**
25 * Class UserGroupFactory
26 *
27 * @package UserAccessManager\UserGroup
28 */
29 class UserGroupFactory
30 {
31 /**
32 * @var Php
33 */
34 private $php;
35
36 /**
37 * @var Wordpress
38 */
39 private $wordpress;
40
41 /**
42 * @var Database
43 */
44 private $database;
45
46 /**
47 * @var MainConfig
48 */
49 private $config;
50
51 /**
52 * @var Util
53 */
54 private $util;
55
56 /**
57 * @var ObjectHandler
58 */
59 private $objectHandler;
60
61 /**
62 * @var AssignmentInformationFactory
63 */
64 private $assignmentInformationFactory;
65
66 /**
67 * UserGroupFactory constructor.
68 *
69 * @param Php $php
70 * @param Wordpress $wordpress
71 * @param Database $database
72 * @param MainConfig $config
73 * @param Util $util
74 * @param ObjectHandler $objectHandler
75 * @param AssignmentInformationFactory $assignmentInformationFactory
76 */
77 public function __construct(
78 Php $php,
79 Wordpress $wordpress,
80 Database $database,
81 MainConfig $config,
82 Util $util,
83 ObjectHandler $objectHandler,
84 AssignmentInformationFactory $assignmentInformationFactory
85 ) {
86 $this->php = $php;
87 $this->wordpress = $wordpress;
88 $this->database = $database;
89 $this->config = $config;
90 $this->util = $util;
91 $this->objectHandler = $objectHandler;
92 $this->assignmentInformationFactory = $assignmentInformationFactory;
93 }
94
95 /**
96 * Creates a new user group object.
97 *
98 * @param null|string $id
99 *
100 * @return UserGroup
101 */
102 public function createUserGroup($id = null)
103 {
104 return new UserGroup(
105 $this->php,
106 $this->wordpress,
107 $this->database,
108 $this->config,
109 $this->util,
110 $this->objectHandler,
111 $this->assignmentInformationFactory,
112 $id
113 );
114 }
115
116 /**
117 * Creates a new dynamic user group object.
118 *
119 * @param string $type
120 * @param string $id
121 *
122 * @return DynamicUserGroup
123 */
124 public function createDynamicUserGroup($type, $id)
125 {
126 return new DynamicUserGroup(
127 $this->php,
128 $this->wordpress,
129 $this->database,
130 $this->config,
131 $this->util,
132 $this->objectHandler,
133 $this->assignmentInformationFactory,
134 $type,
135 $id
136 );
137 }
138 }
139