XF 2.2 Undefined class constant 'TYPE_UINT'

Gossamer

Active member
Hello! I'm trying to build an add-on where members use a form to submit information on a reservation they'd like to make. My Reserves entity, however, throws the following error when I try to call it:
Error: Undefined class constant 'TYPE_UINT' in src\addons\Goss\Reserves\Entity\Reserves.php at line 15

This is my Entity php:
PHP:
<?php

namespace Goss\Reserves\Entity;

use XF\Mvc\Entity\Structure;

class Reserves extends \XF\Mvc\Entity\Entity
{
    public static function getStructure(Structure $structure)
    {
        $structure->table = 'xf_goss_reservation';
        $structure->shortName = 'Goss\Reserves:Reserves';
        $structure->primaryKey = 'id';
        $structure->columns = [
            'id' => ['type' => self::TYPE_UINT, 'required' => true],
            'user_id' => ['type' => self::TYPE_UINT, 'required' => true],
            'username' => ['type' => self::TYPE_STRING, 'required' => true],
            'character' => ['type' => self::TYPE_STRING, 'required' => true],
            'fandom' => ['type' => self::TYPE_STRING, 'required' => true],
            'count' => ['type' => self::TYPE_UINT, 'default' => 1],
            'expiration' => ['type' => self::TYPE_UINT, 'required' => true],
            'orig_date' => ['type' => self::TYPE_UINT, 'default' => time()],
            'hidden' => ['type' => self::TYPE_UINT, 'default' => 0]
        ];
        $structure->getters = [];
        $structure->relations = [
            'User' => [
                'entity' => 'XF:User',
                'type' => self::TO_ONE,
                'conditions' => 'user_id',
                'primary' => true
            ]
        ];
        
        return $structure;
    }
}

?>

Can anybody see what I'm doing wrong?
 

Snog

Well-known member
Code:
'id' => ['type' => self::UINT, 'required' => true],
....

Also, IMO better this way...
Code:
<?php

namespace Goss\Reserves\Entity;

use XF\Mvc\Entity\Entity;
use XF\Mvc\Entity\Structure;

class Reserves extends Entity
....
 
Top