for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Cycle\Schema\Exception\TableInheritance;
use Cycle\Schema\Definition\Entity;
use Cycle\Schema\Exception\TableInheritanceException;
use Yiisoft\FriendlyException\FriendlyExceptionInterface;
class WrongParentKeyColumnException extends TableInheritanceException implements FriendlyExceptionInterface
{
public function __construct(private Entity $entity, string $outerKey)
parent::__construct(sprintf(
'Outer key column `%s` is not found among fields of the `%s` role.',
$outerKey,
(string) ($this->entity->getRole() ?? $this->entity->getClass()),
));
}
public function getName(): string
return 'Outer key column is not found among parent entity fields.';
public function getSolution(): ?string
$fields = implode('`, `', $this->entity->getFields()->getNames());
return sprintf(
'You have to specify one of the defined fields of the `%s` role: `%s`',
$fields,
);