I have a table meetings which is linked to the table teams with table meetings_teams. The relation works fine but, with and empty object loads the data from the related table.
$meeting = new Meeting();
print_r($meeting->teams);
this should come blank but it loads teams from the teams table.
for now i have added the else to BaseTrait to return empty if there is no primary key or ids defined to load the related data. This need to be fixed properly. i have just added this code to make my project run correctly for now.
// Entities always filter by themselves
if (! empty($this->attributes[$this->primaryKey]))
{
$builder->where("{$originating}", $this->attributes[$this->primaryKey]);
}
// Check for an explicit filter request
elseif (! empty($ids))
{
$builder->whereIn("{$originating}", $ids);
} else {
return [];
}
Hi,
I have a table meetings which is linked to the table teams with table meetings_teams. The relation works fine but, with and empty object loads the data from the related table.
this should come blank but it loads teams from the teams table.
for now i have added the else to BaseTrait to return empty if there is no primary key or ids defined to load the related data. This need to be fixed properly. i have just added this code to make my project run correctly for now.