Hi,
I'm building a basic CRUD interface for an invitation system, the problem is that
<xf:delete href="{{ link('invitation/delete', $invitation) }}" />
only returns the invitation/delete link.
This is my invitation Entity
class Invitation extends \XF\Mvc\Entity\Entity
{
public static function getStructure(Structure $structure)
{
$structure->table = 'xf_invitation';
$structure->shortName = 'AVFX\Invitation:Invitation';
$structure->primaryKey = 'invitation_id';
$structure->columns = [
'invitation_id' => ['type' => self::STR],
'user_id' => ['type' => self::INT],
'email' => ['type' => self::STR],
'name_surname' => ['type' => self::STR,'nullable' => true],
'message' => ['type' => self::STR,'nullable' => true],
'created_on' => ['type' => self::INT,'default' => \XF::$time],
'valid_until' => ['type' => self::INT],
'ip_used' => ['type' => self::STR,'nullable' => true],
'used_on' => ['type' => self::INT,'nullable' => true],
'newuser_id' => ['type' => self::INT]
];
$structure->getters = [];
$structure->relations = [
'User' => [
'entity' => 'User',
'type' => self::TO_ONE,
'conditions' => 'user_id',
'primary' => true
],
'NewUser' => [
'entity' => 'User',
'type' => self::TO_ONE,
'conditions' => 'newuser_id',
]
];
return $structure;
}
}
How can I build the correct link, what am I missing?
Thank you very much.
I'm building a basic CRUD interface for an invitation system, the problem is that
<xf:delete href="{{ link('invitation/delete', $invitation) }}" />
only returns the invitation/delete link.
This is my invitation Entity
class Invitation extends \XF\Mvc\Entity\Entity
{
public static function getStructure(Structure $structure)
{
$structure->table = 'xf_invitation';
$structure->shortName = 'AVFX\Invitation:Invitation';
$structure->primaryKey = 'invitation_id';
$structure->columns = [
'invitation_id' => ['type' => self::STR],
'user_id' => ['type' => self::INT],
'email' => ['type' => self::STR],
'name_surname' => ['type' => self::STR,'nullable' => true],
'message' => ['type' => self::STR,'nullable' => true],
'created_on' => ['type' => self::INT,'default' => \XF::$time],
'valid_until' => ['type' => self::INT],
'ip_used' => ['type' => self::STR,'nullable' => true],
'used_on' => ['type' => self::INT,'nullable' => true],
'newuser_id' => ['type' => self::INT]
];
$structure->getters = [];
$structure->relations = [
'User' => [
'entity' => 'User',
'type' => self::TO_ONE,
'conditions' => 'user_id',
'primary' => true
],
'NewUser' => [
'entity' => 'User',
'type' => self::TO_ONE,
'conditions' => 'newuser_id',
]
];
return $structure;
}
}
How can I build the correct link, what am I missing?
Thank you very much.