mirror of
https://github.com/flarum/core.git
synced 2025-10-09 05:56:25 +02:00
- Use contextual namespaces within Flarum\Core - Clean up and docblock everything - Refactor Activity/Notification blueprint stuff - Refactor Formatter stuff - Refactor Search stuff - Upgrade to JSON-API 1.0 - Removed “addedPosts” and “removedPosts” relationships from discussion API. This was used for adding/removing event posts after renaming a discussion etc. Instead we should make an additional request to get all new posts Todo: - Fix Extenders and extensions - Get rid of repository interfaces - Fix other bugs I’ve inevitably introduced
60 lines
1017 B
PHP
60 lines
1017 B
PHP
<?php namespace Flarum\Core\Activity;
|
|
|
|
use Flarum\Core\Users\User;
|
|
|
|
/**
|
|
* An activity blueprint for the 'joined' activity type, which represents a user
|
|
* joining the forum.
|
|
*/
|
|
class JoinedBlueprint implements Blueprint
|
|
{
|
|
/**
|
|
* The user who joined the forum.
|
|
*
|
|
* @var User
|
|
*/
|
|
protected $user;
|
|
|
|
/**
|
|
* Create a new 'joined' activity blueprint.
|
|
*
|
|
* @param User $user The user who joined the forum.
|
|
*/
|
|
public function __construct(User $user)
|
|
{
|
|
$this->user = $user;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getSubject()
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getTime()
|
|
{
|
|
return $this->user->join_time;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function getType()
|
|
{
|
|
return 'joined';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function getSubjectModel()
|
|
{
|
|
return 'Flarum\Core\Users\User';
|
|
}
|
|
}
|