517ed953f2
Refactored AS2 inside AP; [ENTITY][Activity] went from core to AP Webfinger plugin will be part of FreeNetwork component
30 lines
585 B
PHP
30 lines
585 B
PHP
<?php
|
|
|
|
namespace Plugin\ActivityPub\Util\Model\EntityToType;
|
|
|
|
use App\Core\Entity;
|
|
use Plugin\ActivityPub\Util\Type;
|
|
|
|
abstract class EntityToType
|
|
{
|
|
/**
|
|
* @param Entity $entity
|
|
*
|
|
* @throws \Exception
|
|
*
|
|
* @return Type
|
|
*/
|
|
public static function translate($entity)
|
|
{
|
|
switch ($entity::class) {
|
|
case 'Note':
|
|
return NoteToType::translate($entity);
|
|
default:
|
|
$map = [
|
|
'type' => 'Object',
|
|
];
|
|
return Type::create($map);
|
|
}
|
|
}
|
|
}
|