throw new SystemException('invalid value of parameter objects given');
}
+ /** @noinspection PhpVariableVariableInspection */
$this->objectIDs[] = $object->$indexName;
}
else {
public static function sort(&$objects, $sortBy, $sortOrder = 'ASC', $maintainIndexAssociation = true) {
$sortArray = $objects2 = [];
foreach ($objects as $idx => $obj) {
+ /** @noinspection PhpVariableVariableInspection */
$sortArray[$idx] = $obj->$sortBy;
// array_multisort will drop index association if key is not a string
// in case any code should rely on directly accessing user properties,
// refer them to the user profile object
+ /** @noinspection PhpVariableVariableInspection */
return $this->getUserProfile()->$name;
}
}
if (isset($this->parameters[$type])) {
if (is_array($this->parameters[$type])) {
if (isset($this->parameters[$type][$language->languageID])) {
+ /** @noinspection PhpVariableVariableInspection */
$$type = $this->parameters[$type][$language->languageID];
}
}
else {
+ /** @noinspection PhpVariableVariableInspection */
$$type = $this->parameters[$type];
}
}
* @return boolean
*/
public function isAccessible($name) {
+ /** @noinspection PhpVariableVariableInspection */
switch ($this->$name) {
case self::ACCESS_EVERYONE:
return true;
// validate object ids against loaded items (check for zombie object ids)
$indexName = $objectList->getDatabaseTableIndexName();
foreach ($this->markedItems[$objectType] as $object) {
+ /** @noinspection PhpVariableVariableInspection */
$index = array_search($object->$indexName, $objectData['objectIDs']);
unset($objectData['objectIDs'][$index]);
}
$returnValue = "";
foreach ($userGroups as $userGroup) {
+ /** @noinspection PhpVariableVariableInspection */
$returnValue .= "<label><input type=\"checkbox\" name=\"".$identifier."[]\" value=\"".$userGroup->groupID."\"".(in_array($userGroup->groupID, $this->$identifier) ? ' checked="checked"' : "")." /> ".$userGroup->getName()."</label>";
}
* @return string
*/
protected function getCheckedAttribute($propertyName) {
+ /** @noinspection PhpVariableVariableInspection */
if ($this->$propertyName) {
return ' checked="checked"';
}
protected function validate(DatabaseObject $object, $optionsColumnName = 'options', $permissionsColumnName = 'permissions') {
// check the options of this item
$hasEnabledOption = true;
+ /** @noinspection PhpVariableVariableInspection */
if ($object->$optionsColumnName) {
$hasEnabledOption = false;
+ /** @noinspection PhpVariableVariableInspection */
$options = explode(',', strtoupper($object->$optionsColumnName));
foreach ($options as $option) {
if (defined($option) && constant($option)) {
// check the permission of this item for the active user
$hasPermission = true;
+ /** @noinspection PhpVariableVariableInspection */
if ($object->$permissionsColumnName) {
$hasPermission = false;
+ /** @noinspection PhpVariableVariableInspection */
$permissions = explode(',', $object->$permissionsColumnName);
foreach ($permissions as $permission) {
if (WCF::getSession()->getPermission($permission)) {
* @return mixed
*/
public function __get($name) {
+ /** @noinspection PhpVariableVariableInspection */
return $this->userProfile->$name;
}