This commit is contained in:
2023-11-28 04:39:36 +08:00
parent a9ac0e48b3
commit dc37274b6c
86 changed files with 2106 additions and 191 deletions

17
app/JsonLd/FAQPage.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
namespace App\JsonLd;
use JsonLd\ContextTypes\AbstractContext;
class FAQPage extends AbstractContext
{
protected $structure = [
'mainEntity' => [],
];
protected function setMainEntityAttribute($value)
{
return (array) $value;
}
}

View File

@@ -0,0 +1,77 @@
<?php
namespace App\JsonLd;
use JsonLd\ContextTypes\AbstractContext;
use JsonLd\ContextTypes\ImageObject;
class SoftwareApplication extends AbstractContext
{
/**
* Property structure
*
* @var array
*/
protected $structure = [
'name' => null,
'description' => null,
'url' => null,
'applicationCategory' => null,
'screenshot' => ImageObject::class,
];
/**
* Set the name attribute.
*
* @param string $value
* @return string
*/
protected function setNameAttribute($value)
{
return (string) $value;
}
/**
* Set the description attribute.
*
* @param string $value
* @return string
*/
protected function setDescriptionAttribute($value)
{
return $this->truncate($value, 260);
}
/**
* Set the url attribute.
*
* @param string $value
* @return string
*/
protected function setUrlAttribute($value)
{
return (string) $value;
}
/**
* Set the application category attribute.
*
* @param string $value
* @return string
*/
protected function setApplicationCategoryAttribute($value)
{
return (string) $value;
}
/**
* Set the screenshot attribute.
*
* @param ImageObject|array $value
* @return ImageObject
*/
protected function setScreenshotAttribute($value)
{
return new ImageObject([$value]);
}
}