public function __construct(SchemaFactoryInterface $factory)
{
$isOk = is_string($this->getResourceType()) === true && empty($this->getResourceType()) === false;
if ($isOk === false) {
throw new InvalidArgumentException(T::t('Resource type is not set for Schema \'%s\'.', [static::class]));
}
if ($this->selfSubUrl === null) {
$this->selfSubUrl = '/' . $this->getResourceType();
} else {
$isOk = is_string($this->selfSubUrl) === true && empty($this->selfSubUrl) === false && $this->selfSubUrl[0] === '/' && $this->selfSubUrl[strlen($this->selfSubUrl) - 1] != '/';
if ($isOk === false) {
$message = T::t('\'Self\' sub-url set incorrectly for Schema \'%s\'.', [static::class]);
throw new InvalidArgumentException($message);
}
}
$this->factory = $factory;
}