M schema.yml:
News:
columns:
title:
type: string(50)
category_id:
type: integer(4)
relations:
Category:
local: category_id
That is because you are trying to view a column named category_name
and you don't have a getCategory_Name()
method, the solution is very simple. Display the categoryname
column not category_name
.
config:
actions: ~
fields: ~
list:
display: [news_id, title, categoryname]
table_method: doSelectJoinCategory
filter:
display: [news_id, title, category_id]
form: ~
edit: ~
new: ~
public function getCategoryName()
{
return $this->getCategories()->getCategoryName();
}