2021-08-05 15:18:39 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Daniel Siepmann <coding@daniel-siepmann.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
* 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace WerkraumMedia\ThueCat\Domain\Import\Entity;
|
|
|
|
|
2022-11-24 11:05:13 +01:00
|
|
|
use WerkraumMedia\ThueCat\Domain\Import\Entity\Properties\ForeignReference;
|
|
|
|
|
2021-08-10 09:21:24 +02:00
|
|
|
class MediaObject extends Minimum implements MapsToType
|
2021-08-05 15:18:39 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
protected $copyrightYear = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $license = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $licenseAuthor = '';
|
|
|
|
|
2022-11-24 11:05:13 +01:00
|
|
|
/**
|
|
|
|
* @var string|ForeignReference
|
|
|
|
*/
|
|
|
|
protected $author;
|
|
|
|
|
2021-08-05 15:18:39 +02:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $type = '';
|
|
|
|
|
|
|
|
public function getCopyrightYear(): int
|
|
|
|
{
|
|
|
|
return $this->copyrightYear;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLicense(): string
|
|
|
|
{
|
|
|
|
return $this->license;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLicenseAuthor(): string
|
|
|
|
{
|
|
|
|
return $this->licenseAuthor;
|
|
|
|
}
|
|
|
|
|
2022-11-24 11:05:13 +01:00
|
|
|
/**
|
|
|
|
* @return string|ForeignReference
|
|
|
|
*/
|
|
|
|
public function getAuthor()
|
|
|
|
{
|
|
|
|
return $this->author;
|
|
|
|
}
|
|
|
|
|
2021-08-05 15:18:39 +02:00
|
|
|
public function getType(): string
|
|
|
|
{
|
|
|
|
return $this->type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal for mapping via Symfony component.
|
|
|
|
*/
|
|
|
|
public function setCopyrightYear(string $copyrightYear): void
|
|
|
|
{
|
2023-11-30 13:52:23 +01:00
|
|
|
$this->copyrightYear = (int)$copyrightYear;
|
2021-08-05 15:18:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal for mapping via Symfony component.
|
|
|
|
*/
|
|
|
|
public function setLicense(string $license): void
|
|
|
|
{
|
|
|
|
$this->license = $license;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal for mapping via Symfony component.
|
|
|
|
*/
|
|
|
|
public function setLicenseAuthor(string $licenseAuthor): void
|
|
|
|
{
|
|
|
|
$this->licenseAuthor = $licenseAuthor;
|
|
|
|
}
|
|
|
|
|
2022-11-24 11:05:13 +01:00
|
|
|
/**
|
|
|
|
* @internal for mapping via Symfony component.
|
2023-11-30 13:52:23 +01:00
|
|
|
*
|
2022-11-24 11:05:13 +01:00
|
|
|
* @param string|ForeignReference $author
|
|
|
|
*/
|
|
|
|
public function setAuthor($author): void
|
|
|
|
{
|
|
|
|
$this->author = $author;
|
|
|
|
}
|
|
|
|
|
2021-08-05 15:18:39 +02:00
|
|
|
/**
|
|
|
|
* @internal for mapping via Symfony component.
|
|
|
|
*/
|
|
|
|
public function setType(array $type): void
|
|
|
|
{
|
|
|
|
if (in_array('schema:ImageObject', $type)) {
|
|
|
|
$this->type = 'image';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getSupportedTypes(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'schema:MediaObject',
|
|
|
|
];
|
|
|
|
}
|
2021-08-18 13:54:18 +02:00
|
|
|
|
|
|
|
public static function getPriority(): int
|
|
|
|
{
|
|
|
|
return 10;
|
|
|
|
}
|
2021-08-05 15:18:39 +02:00
|
|
|
}
|