[Embed][ENTITY] Fix embed route and use attachment_view rather than _show. Rename Entity::have to Entity::has, because grammar

This commit is contained in:
2021-04-28 20:15:43 +00:00
parent 30107de079
commit b1e514832b
3 changed files with 18 additions and 15 deletions

View File

@@ -33,8 +33,8 @@ abstract class Entity
{
public function __call(string $name , array $arguments): mixed
{
if (Formatting::startsWith($name, 'have')) {
$prop = Formatting::camelCaseToSnakeCase(Formatting::removePrefix($name, 'have'));
if (Formatting::startsWith($name, 'has')) {
$prop = Formatting::camelCaseToSnakeCase(Formatting::removePrefix($name, 'has'));
return isset($this->{$prop});
}
throw new \Exception("Entity::{$name} called with bogus arguments: " . print_r($arguments, true));