Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace apathy\UsernameStyles\Entity;
- use XF\Mvc\Entity\Structure;
- class Username extends \XF\Mvc\Entity\Entity
- {
- public static function getStructure(Structure $structure)
- {
- $structure->table = 'xf_ap_username_styles';
- $structure->shortName = 'apathy\UsernameStyles:Username';
- $structure->primaryKey = 'style_id';
- $structure->columns = [
- 'style_id' => ['type' => self::UINT, 'required' => true],
- 'user_id' => ['type' => self::UINT, 'default' => 0],
- 'bold' => ['type' => self::UINT, 'maxLength' => 3, 'default' => 0],
- 'color' => ['type' => self::STR, 'maxLength' => 30, 'default' => false],
- 'glow' => ['type' => self::STR, 'maxLength' => 90, 'default' => false],
- 'sparkle' => ['type' => self::UINT, 'maxLength' => 3, 'default' => 0]
- ];
- $structure->getters = [];
- $structure->relations = [
- 'User' => [
- 'entity' => 'XF:User',
- 'type' => self::TO_ONE,
- 'conditions' => 'user_id',
- 'primary' => true
- ],
- ];
- return $structure;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement