| 1 |
<?php |
| 2 |
/*! |
| 3 |
* Hybridauth |
| 4 |
* https://hybridauth.github.io | https://github.com/hybridauth/hybridauth |
| 5 |
* (c) 2017 Hybridauth authors | https://hybridauth.github.io/license.html |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Hybridauth\User; |
| 9 |
|
| 10 |
use Hybridauth\Exception\UnexpectedValueException; |
| 11 |
|
| 12 |
/** |
| 13 |
* Hybridauth\User\Activity |
| 14 |
*/ |
| 15 |
final class Activity |
| 16 |
{ |
| 17 |
/** |
| 18 |
* activity id on the provider side, usually given as integer |
| 19 |
* |
| 20 |
* @var string |
| 21 |
*/ |
| 22 |
public $id = null; |
| 23 |
|
| 24 |
/** |
| 25 |
* activity date of creation |
| 26 |
* |
| 27 |
* @var string |
| 28 |
*/ |
| 29 |
public $date = null; |
| 30 |
|
| 31 |
/** |
| 32 |
* activity content as a string |
| 33 |
* |
| 34 |
* @var string |
| 35 |
*/ |
| 36 |
public $text = null; |
| 37 |
|
| 38 |
/** |
| 39 |
* user who created the activity |
| 40 |
* |
| 41 |
* @var object |
| 42 |
*/ |
| 43 |
public $user = null; |
| 44 |
|
| 45 |
/** |
| 46 |
* |
| 47 |
*/ |
| 48 |
public function __construct() |
| 49 |
{ |
| 50 |
$this->user = new \stdClass(); |
| 51 |
|
| 52 |
// typically, we should have a few information about the user who created the event from social apis |
| 53 |
$this->user->identifier = null; |
| 54 |
$this->user->displayName = null; |
| 55 |
$this->user->profileURL = null; |
| 56 |
$this->user->photoURL = null; |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Prevent the providers adapters from adding new fields. |
| 61 |
* |
| 62 |
* @throws UnexpectedValueException |
| 63 |
* @var string $name |
| 64 |
* |
| 65 |
* @var mixed $value |
| 66 |
* |
| 67 |
*/ |
| 68 |
public function __set($name, $value) |
| 69 |
{ |
| 70 |
// phpcs:ignore |
| 71 |
throw new UnexpectedValueException(sprintf('Adding new property "%s\' to %s is not allowed.', $name, __CLASS__)); |
| 72 |
} |
| 73 |
} |
| 74 |
|