| 1 |
<?php |
| 2 |
/** |
| 3 |
* ObjectInformation.php |
| 4 |
* |
| 5 |
* The ObjectInformation 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 |
|
| 16 |
declare(strict_types=1); |
| 17 |
|
| 18 |
namespace UserAccessManager\Controller\Backend; |
| 19 |
|
| 20 |
use UserAccessManager\UserGroup\AbstractUserGroup; |
| 21 |
|
| 22 |
/** |
| 23 |
* Class ObjectInformation |
| 24 |
* |
| 25 |
* @package UserAccessManager\Controller\Backend |
| 26 |
*/ |
| 27 |
class ObjectInformation |
| 28 |
{ |
| 29 |
/** |
| 30 |
* @var null|string |
| 31 |
*/ |
| 32 |
protected $objectType = null; |
| 33 |
|
| 34 |
/** |
| 35 |
* @var null|string |
| 36 |
*/ |
| 37 |
protected $objectId = null; |
| 38 |
|
| 39 |
/** |
| 40 |
* @var int |
| 41 |
*/ |
| 42 |
protected $userGroupDiff = 0; |
| 43 |
|
| 44 |
/** |
| 45 |
* @var AbstractUserGroup[] |
| 46 |
*/ |
| 47 |
protected $objectUserGroups = []; |
| 48 |
|
| 49 |
/** |
| 50 |
* Sets the object type. |
| 51 |
* @param string $objectType |
| 52 |
* @return $this |
| 53 |
*/ |
| 54 |
public function setObjectType(string $objectType): ObjectInformation |
| 55 |
{ |
| 56 |
$this->objectType = $objectType; |
| 57 |
return $this; |
| 58 |
} |
| 59 |
|
| 60 |
/** |
| 61 |
* Returns the current object type. |
| 62 |
* @return null|string |
| 63 |
*/ |
| 64 |
public function getObjectType(): ?string |
| 65 |
{ |
| 66 |
return $this->objectType; |
| 67 |
} |
| 68 |
|
| 69 |
/** |
| 70 |
* Sets the object id. |
| 71 |
* @param $objectId |
| 72 |
* @return $this |
| 73 |
*/ |
| 74 |
public function setObjectId($objectId): ObjectInformation |
| 75 |
{ |
| 76 |
$this->objectId = $objectId; |
| 77 |
return $this; |
| 78 |
} |
| 79 |
|
| 80 |
/** |
| 81 |
* Returns the current object id. |
| 82 |
* @return int|string|null |
| 83 |
*/ |
| 84 |
public function getObjectId() |
| 85 |
{ |
| 86 |
return $this->objectId; |
| 87 |
} |
| 88 |
|
| 89 |
/** |
| 90 |
* Sets the user group diff count. |
| 91 |
* @param int $userGroupDiff |
| 92 |
* @return $this |
| 93 |
*/ |
| 94 |
public function setUserGroupDiff(int $userGroupDiff): ObjectInformation |
| 95 |
{ |
| 96 |
$this->userGroupDiff = $userGroupDiff; |
| 97 |
return $this; |
| 98 |
} |
| 99 |
|
| 100 |
/** |
| 101 |
* Returns the user group count diff. |
| 102 |
* @return int |
| 103 |
*/ |
| 104 |
public function getUserGroupDiff(): int |
| 105 |
{ |
| 106 |
return $this->userGroupDiff; |
| 107 |
} |
| 108 |
|
| 109 |
/** |
| 110 |
* Sets the user group diff count. |
| 111 |
* @param $objectUserGroups |
| 112 |
* @return $this |
| 113 |
*/ |
| 114 |
public function setObjectUserGroups($objectUserGroups): ObjectInformation |
| 115 |
{ |
| 116 |
$this->objectUserGroups = $objectUserGroups; |
| 117 |
return $this; |
| 118 |
} |
| 119 |
|
| 120 |
/** |
| 121 |
* Returns the current object user groups. |
| 122 |
* @return AbstractUserGroup[] |
| 123 |
*/ |
| 124 |
public function getObjectUserGroups(): array |
| 125 |
{ |
| 126 |
return $this->objectUserGroups; |
| 127 |
} |
| 128 |
} |
| 129 |
|