add seo plugin
This commit is contained in:
parent
23dbb65314
commit
e69dc23c91
1909 changed files with 1111579 additions and 10 deletions
46
vendor/spatie/schema-org/generator/Property.php
vendored
Normal file
46
vendor/spatie/schema-org/generator/Property.php
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace Spatie\SchemaOrg\Generator;
|
||||
|
||||
class Property
|
||||
{
|
||||
public string $name;
|
||||
|
||||
public string $description;
|
||||
|
||||
public string $resource;
|
||||
|
||||
/** @var Type[] */
|
||||
public array $types = [];
|
||||
|
||||
/** @var string[] */
|
||||
public array $ranges = [];
|
||||
|
||||
public bool $pending = false;
|
||||
|
||||
public ?string $partOf;
|
||||
|
||||
public ?string $source;
|
||||
|
||||
public function addType(string $type): void
|
||||
{
|
||||
$this->types[] = $type;
|
||||
}
|
||||
|
||||
public function addRanges(array $ranges): void
|
||||
{
|
||||
foreach ($ranges as $range) {
|
||||
$this->addRange($range);
|
||||
}
|
||||
|
||||
sort($this->ranges);
|
||||
}
|
||||
|
||||
private function addRange(string $range): void
|
||||
{
|
||||
$this->ranges[] = $range;
|
||||
$this->ranges[] = "{$range}[]";
|
||||
|
||||
$this->ranges = array_unique($this->ranges);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue