Taylor J
Well-known member
I'm in need of some guidance when it comes to setting up multiple entity relations when extending a class (User in this instance).
This is my current User entity in my addon that I am extending
but currently I am getting this error back on every page (forum home, members, what's new, etc)
I should add that it also returns the same error if I remove the Blog Posts relation and only have the Blogs one there.
Is there something I'm just doing completely wrong here?
This is my current User entity in my addon that I am extending
PHP:
<?php
namespace TaylorJ\Blogs\Entity;
use XF\MVC\Entity\Structure;
class User extends \XF\Entity\User
{
public static function getStructure(\XF\Mvc\Entity\Structure $structure)
{
$structure = parent::getStructure($structure);
$structure->relations = [
'Blogs' => [
'entity' => 'TaylorJ\Blogs:Blogs',
'type' => self::TO_ONE,
'conditions' => 'blog_id',
'primary' => true
],
'Blog Posts' => [
'entity' => 'TaylorJ\Blogs:Posts',
'type' => self::TO_MANY,
'conditions' => 'post_id',
'primary' => true
]
];
return $structure;
}
}
Code:
Template Compilation Error
public:forum_list - Unknown relation or alias Privacy accessed on xf_user in /Users/taylorjones/Development/apache/php7/xf/src/XF/Mvc/Entity/Finder.php:768
Is there something I'm just doing completely wrong here?