public $itemID = 0;
/**
- * menu object
- * @var Menu
+ * menu item object
+ * @var MenuItem
*/
- public $menuItem = null;
+ public $menuItem;
/**
* @inheritDoc
// validate accessibility
$className = $this->className;
+ /** @noinspection PhpUndefinedFieldInspection */
if (!property_exists($className, 'allowInvoke') || !in_array($this->actionName, $className::$allowInvoke)) {
throw new PermissionDeniedException();
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Data
* @since 3.0
+ *
+ * @property-read string $fileType type of the physical attachment file
+ * @property-read integer $isImage is `1` if the file is an image, otherwise `0`
+ * @property-read integer $width width of the file if `$isImage` is `1`, otherwise `0`
+ * @property-read integer $height height of the file if `$isImage` is `1`, otherwise `0`
*/
interface IFile extends IStorableObject {
/**
/** @noinspection PhpUndefinedMethodInspection */
$this->parameters['__files']->saveFiles($saveStrategy);
+
+ /** @var Attachment[] $attachments */
$attachments = $saveStrategy->getObjects();
// return result
foreach ($usedCategories as $categoryName => $categoryID) {
if ($categoryID) continue;
+ /** @var LanguageCategory $category */
$category = LanguageCategoryEditor::create([
'languageCategory' => $categoryName
]);
* @method Media getDecoratedObject()
* @mixin Media
* @property-read string|null $title title of the media file in the active user's language or `null` if object has not been fetched via `ViewableMediaList`
- * @property-read string|null $description description of the media file in the active user's language or `null` if object has not been fetched via `ViewableMediaList`
+ * @property-read string|null $caption caption of the media file in the active user's language or `null` if object has not been fetched via `ViewableMediaList`
* @property-read string|null $altText alternative text of the media file in the active user's language or `null` if object has not been fetched via `ViewableMediaList`
*/
class ViewableMedia extends DatabaseObjectDecorator {
public function getLabel() {
$definition = ObjectTypeCache::getInstance()->getDefinition(ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID)->definitionID);
+ /** @noinspection PhpUndefinedFieldInspection */
if ($definition->definitionName == 'com.woltlab.wcf.moderation.activation' && $this->getAffectedObject()->enableTime) {
return WCF::getLanguage()->get('wcf.moderation.type.com.woltlab.wcf.moderation.activation.delayed');
}
*
* @method Tag getDecoratedObject()
* @mixin Tag
+ *
+ * @property-read integer|null $counter number of the times the tag has been used for a certain object type or `null`
*/
class TagCloudTag extends DatabaseObjectDecorator {
/**
* @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Data\User\Group\Option
- *
+ *
+ * @property-read string $defaultValue default value of the user option
* @property-read integer $usersOnly is `1` if the option only applies to user groups for registered users, otherwise `1`
*/
class UserGroupOption extends Option {
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Data\User\Option
*
+ * @property-read string $defaultValue default value of the user option
* @property-read integer $required is `1` if the user option has to be filled out, otherwise `0`
* @property-read integer $askDuringRegistration is `1` if the user option will be shown during registration to be filled out, otherwise `0`
* @property-read integer $editable setting for who can edit the user option, see `UserOption::EDITABILITY_*` constants
$application = 'wcf';
if (count($this->selectedObjectTypes) == 1) {
$objectType = SearchEngine::getInstance()->getObjectType(reset($this->selectedObjectTypes));
+ /** @noinspection PhpUndefinedFieldInspection */
if ($tmp = ApplicationHandler::getInstance()->getAbbreviation($objectType->packageID)) {
$application = $tmp;
}
$editor->updateCounters(['profileHits' => 1]);
// save visitor
+ /** @noinspection PhpUndefinedFieldInspection */
if (PROFILE_ENABLE_VISITORS && WCF::getUser()->userID && !WCF::getUser()->canViewOnlineStatus) {
if (($visitor = UserProfileVisitor::getObject($this->user->userID, WCF::getUser()->userID)) !== null) {
$editor = new UserProfileVisitorEditor($visitor);
'objectTypeCategoryIDs' => []
];
foreach ($list as $category) {
- if (!isset($data['objectTypeCategoryIDs'][$category->objectType])) {
- $data['objectTypeCategoryIDs'][$category->objectType] = [];
+ /** @noinspection PhpUndefinedFieldInspection */
+ $objectType = $category->objectType;
+
+ if (!isset($data['objectTypeCategoryIDs'][$objectType])) {
+ $data['objectTypeCategoryIDs'][$objectType] = [];
}
- $data['objectTypeCategoryIDs'][$category->objectType][] = $category->categoryID;
+ $data['objectTypeCategoryIDs'][$objectType][] = $category->categoryID;
}
return $data;
ORDER BY showOrder";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
+
+ /** @var Option $option */
while ($option = $statement->fetchObject($this->optionClassName)) {
$data['options'][$option->optionName] = $option;
if (!isset($data['optionToCategories'][$option->categoryName])) {
}
if (!isset($data[$objectType->objectType])) {
- if ($objectType->listclassname == '') {
+ /** @noinspection PhpUndefinedFieldInspection */
+ $listClassName = $objectType->listclassname;
+ if ($listClassName == '') {
throw new SystemException("Missing list class for object type '".$objectType->objectType."'");
}
$data[$objectType->objectType] = [
- 'className' => $objectType->listclassname,
+ 'className' => $listClassName,
'objectIDs' => []
];
}
* @inheritDoc
*/
public function setData(Condition $condition) {
- if ($condition->endTime) {
- $this->endTime = $condition->endTime;
+ /** @noinspection PhpUndefinedFieldInspection */
+ $endTime = $condition->endTime;
+ if ($endTime) {
+ $this->endTime = $endTime;
}
- if ($condition->startTime) {
- $this->startTime = $condition->startTime;
+
+ /** @noinspection PhpUndefinedFieldInspection */
+ $startTime = $condition->startTime;
+ if ($startTime) {
+ $this->startTime = $startTime;
}
}
$date = DateUtil::getDateTimeByTimestamp(TIME_NOW);
$date->setTimezone(WCF::getUser()->getTimeZone());
+ /** @noinspection PhpUndefinedFieldInspection */
return in_array($date->format('w'), $condition->daysOfWeek);
}
}
* @inheritDoc
*/
public function setData(Condition $condition) {
- if ($condition->endTime) {
- $this->endTime = $condition->endTime;
+ /** @noinspection PhpUndefinedFieldInspection */
+ $endTime = $condition->endTime;
+ if ($endTime) {
+ $this->endTime = $endTime;
}
- if ($condition->startTime) {
- $this->startTime = $condition->startTime;
+
+ /** @noinspection PhpUndefinedFieldInspection */
+ $startTime = $condition->startTime;
+ if ($startTime) {
+ $this->startTime = $startTime;
}
- if ($condition->timezone) {
- $this->timezone = $condition->timezone;
+
+ /** @noinspection PhpUndefinedFieldInspection */
+ $timezone = $condition->timezone;
+ if ($timezone) {
+ $this->timezone = $timezone;
}
}
*/
public function showContent(Condition $condition) {
$timezone = WCF::getUser()->getTimeZone();
- if ($condition->timezone) {
- $timezone = new \DateTimeZone($condition->timezone);
+ /** @noinspection PhpUndefinedFieldInspection */
+ $conditionTimezone = $condition->timezone;
+ if ($conditionTimezone) {
+ $timezone = new \DateTimeZone($conditionTimezone);
}
- if ($condition->startTime) {
- $dateTime = \DateTime::createFromFormat('H:i', $condition->startTime, $timezone);
+ /** @noinspection PhpUndefinedFieldInspection */
+ $startTime = $condition->startTime;
+ if ($startTime) {
+ $dateTime = \DateTime::createFromFormat('H:i', $startTime, $timezone);
if ($dateTime->getTimestamp() > TIME_NOW) {
return false;
}
}
- if ($condition->endTime) {
- $dateTime = \DateTime::createFromFormat('H:i', $condition->endTime, $timezone);
+ /** @noinspection PhpUndefinedFieldInspection */
+ $endTime = $condition->endTime;
+ if ($endTime) {
+ $dateTime = \DateTime::createFromFormat('H:i', $endTime, $timezone);
if ($dateTime->getTimestamp() < TIME_NOW) {
return false;
}
* @inheritDoc
*/
public function checkUser(Condition $condition, User $user) {
+ /** @noinspection PhpUndefinedFieldInspection */
$optionValues = $condition->optionValues;
$checkSuccess = true;
* @inheritDoc
*/
public function checkUser(Condition $condition, User $user) {
- if ($condition->registrationDateStart !== null && $user->registrationDate < strtotime($condition->registrationDateStart)) {
+ /** @noinspection PhpUndefinedFieldInspection */
+ $registrationDateStart = $condition->registrationDateStart;
+ if ($registrationDateStart !== null && $user->registrationDate < strtotime($registrationDateStart)) {
return false;
}
- if ($condition->registrationDateEnd !== null && $user->registrationDate >= strtotime($condition->registrationDateEnd) + 86400) {
+
+ /** @noinspection PhpUndefinedFieldInspection */
+ $registrationDateEnd = $condition->registrationDateEnd;
+ if ($registrationDateEnd !== null && $user->registrationDate >= strtotime($registrationDateEnd) + 86400) {
return false;
}
* @inheritDoc
*/
public function setData(Condition $condition) {
- if ($condition->registrationDateEnd) {
- $this->registrationDateEnd = $condition->registrationDateEnd;
+ /** @noinspection PhpUndefinedFieldInspection */
+ $registrationDateEnd = $condition->registrationDateEnd;
+ if ($registrationDateEnd) {
+ $this->registrationDateEnd = $registrationDateEnd;
}
- if ($condition->registrationDateStart) {
- $this->registrationDateStart = $condition->registrationDateStart;
+
+ /** @noinspection PhpUndefinedFieldInspection */
+ $registrationDateStart = $condition->registrationDateStart;
+ if ($registrationDateStart) {
+ $this->registrationDateStart = $registrationDateStart;
}
}
* @inheritDoc
*/
public function checkUser(Condition $condition, User $user) {
- if ($condition->greaterThan !== null && $user->registrationDate >= TIME_NOW - $condition->greaterThan * 86400) {
+ /** @noinspection PhpUndefinedFieldInspection */
+ $greaterThan = $condition->greaterThan;
+ if ($greaterThan !== null && $user->registrationDate >= TIME_NOW - $greaterThan * 86400) {
return false;
}
- if ($condition->lessThan !== null && $user->registrationDate <= TIME_NOW - $condition->lessThan * 86400) {
+
+ /** @noinspection PhpUndefinedFieldInspection */
+ $lessThan = $condition->lessThan;
+ if ($lessThan !== null && $user->registrationDate <= TIME_NOW - $lessThan * 86400) {
return false;
}
* @inheritDoc
*/
public function checkUser(Condition $condition, User $user) {
- if ($condition->userIsBanned !== null && $user->banned != $condition->userIsBanned) {
+ /** @noinspection PhpUndefinedFieldInspection */
+ $userIsBanned = $condition->userIsBanned;
+ if ($userIsBanned !== null && $user->banned != $userIsBanned) {
return false;
}
- if ($condition->userIsEnabled !== null) {
- if ($condition->userIsEnabled && $user->activationCode) {
+ /** @noinspection PhpUndefinedFieldInspection */
+ $userIsEnabled = $condition->userIsEnabled;
+ if ($userIsEnabled !== null) {
+ if ($userIsEnabled && $user->activationCode) {
return false;
}
- else if (!$condition->userIsEnabled && !$user->activationCode) {
+ else if (!$userIsEnabled && !$user->activationCode) {
return false;
}
}
* @inheritDoc
*/
public function setData(Condition $condition) {
+ /** @noinspection PhpUndefinedFieldInspection */
+ $userIsBanned = $condition->userIsBanned;
if ($condition->userIsBanned !== null) {
- $this->userIsBanned = $condition->userIsBanned;
- $this->userIsNotBanned = !$condition->userIsBanned;
+ $this->userIsBanned = $userIsBanned;
+ $this->userIsNotBanned = !$userIsBanned;
}
+
+ /** @noinspection PhpUndefinedFieldInspection */
+ $userIsEnabled = $condition->userIsEnabled;
if ($condition->userIsEnabled !== null) {
- $this->userIsEnabled = $condition->userIsEnabled;
- $this->userIsDisabled = !$condition->userIsEnabled;
+ $this->userIsEnabled = $userIsEnabled;
+ $this->userIsDisabled = !$userIsEnabled;
}
}
* @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\Message\Embedded\Object
+ *
+ * @property-read integer $objectTypeID id of the embedded object type
*/
interface IMessageEmbeddedObjectHandler {
/**
namespace wcf\system\option\user;
use wcf\data\option\category\OptionCategory;
use wcf\data\option\Option;
+use wcf\data\user\option\category\UserOptionCategory;
use wcf\data\user\option\UserOption;
use wcf\data\user\option\ViewableUserOption;
use wcf\data\user\User;
* @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\Option\User
+ *
+ * @property UserOptionCategory $cachedCategories
+ * @property UserOption[] $cachedOptions
+ * @property UserOption[] $options
*/
class UserOptionHandler extends OptionHandler {
/**
* @inheritDoc
*/
protected function validateOption(Option $option) {
+ /** @var UserOption $option */
+
parent::validateOption($option);
if ($option->required && $option->optionType != 'boolean' && empty($this->optionValues[$option->optionName])) {
}
$conditionBuilder = new PreparedStatementConditionBuilder();
+ /** @noinspection PhpUndefinedFieldInspection */
$conditionBuilder->add('category.objectTypeID = ?', [ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.category', $className::OBJECT_TYPE_NAME)]);
$conditionBuilder->add('(category.title LIKE ? OR language_item.languageItemValue LIKE ?)', ['%' . $searchString . '%', '%' . $searchString . '%']);
$sql = "SELECT DISTINCT categoryID
$tags = [];
while ($tag = $statement->fetchObject(Tag::class)) {
- if (!isset($tags[$tag->objectID])) {
- $tags[$tag->objectID] = [];
+ /** @noinspection PhpUndefinedFieldInspection */
+ $objectID = $tag->objectID;
+ if (!isset($tags[$objectID])) {
+ $tags[$objectID] = [];
}
- $tags[$tag->objectID][$tag->tagID] = $tag;
+ $tags[$objectID][$tag->tagID] = $tag;
}
return $tags;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\email\Email;
use wcf\system\moderation\queue\report\IModerationQueueReportHandler;
+use wcf\system\user\notification\object\CommentResponseUserNotificationObject;
use wcf\system\WCF;
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\User\Notification\Event
* @since 3.0
+ *
+ * @method CommentResponseUserNotificationObject getUserNotificationObject()
*/
class ModerationQueueCommentResponseUserNotificationEvent extends AbstractSharedUserNotificationEvent {
/**
* @inheritDoc
*/
public function getEmailMessage($notificationType = 'instant') {
- $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
+ $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID);
if ($comment->userID) {
$commentAuthor = UserProfileRuntimeCache::getInstance()->getObject($comment->userID);
}
]);
}
- $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
+ $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID);
if ($comment->userID) {
$commentAuthor = UserProfileRuntimeCache::getInstance()->getObject($comment->userID);
}
*/
public function getModerationQueue() {
if (!$this->moderationQueueLoaded) {
- $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
+ $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID);
$this->moderationQueue = ViewableModerationQueue::getViewableModerationQueue($comment->objectID);
$this->moderationQueueLoaded = true;
* @inheritDoc
*/
protected function prepare() {
- CommentRuntimeCache::getInstance()->cacheObjectID($this->userNotificationObject->commentID);
+ CommentRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->commentID);
UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['userID']);
}
}
use wcf\data\user\UserProfile;
use wcf\system\email\Email;
use wcf\system\moderation\queue\IModerationQueueHandler;
+use wcf\system\user\notification\object\CommentUserNotificationObject;
use wcf\system\user\notification\object\IUserNotificationObject;
use wcf\system\WCF;
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\User\Notification\Event
* @since 3.0
+ *
+ * @method CommentUserNotificationObject getUserNotificationObject()
*/
class ModerationQueueCommentUserNotificationEvent extends AbstractUserNotificationEvent {
/**
parent::setObject($notification, $object, $author, $additionalData);
// if the active user has no access, $this->moderationQueue is null
- $this->moderationQueue = ViewableModerationQueue::getViewableModerationQueue($this->userNotificationObject->objectID);
+ $this->moderationQueue = ViewableModerationQueue::getViewableModerationQueue($this->getUserNotificationObject()->objectID);
if ($this->moderationQueue) {
/** @var IModerationQueueHandler $moderationHandler */
<?php
namespace wcf\system\user\notification\event;
use wcf\system\request\LinkHandler;
+use wcf\system\user\notification\object\UserFollowUserNotificationObject;
/**
* Notification event for followers.
* @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\User\Notification\Event
+ *
+ * @method UserFollowUserNotificationObject getUserNotificationObject()
*/
class UserFollowFollowingUserNotificationEvent extends AbstractUserNotificationEvent {
/**
* @inheritDoc
*/
public function getEventHash() {
- return sha1($this->eventID . '-' . $this->userNotificationObject->followUserID);
+ return sha1($this->eventID . '-' . $this->getUserNotificationObject()->followUserID);
}
}