Advertisement
Guest User

Entity\Postbit.php

a guest
Jan 24th, 2021
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2.  
  3. namespace apathy\UsernameStyles\Entity;
  4.  
  5. use XF\Mvc\Entity\Structure;
  6.  
  7. class Postbit extends \XF\Mvc\Entity\Entity
  8. {
  9. public static function getStructure(Structure $structure)
  10. {
  11. $structure->table = 'xf_ap_postbit_styles';
  12. $structure->shortName = 'apathy\UsernameStyles:Postbit';
  13. $structure->primaryKey = 'bit_id';
  14. $structure->columns = [
  15. 'bit_id' => ['type' => self::UINT, 'required' => true],
  16. 'user_id' => ['type' => self::UINT, 'default' => 0],
  17. 'disable' => ['type' => self::UINT, 'maxLength' => 3, 'default' => 0],
  18. 'bg' => ['type' => self::STR, 'maxLength' => 90, 'default' => false],
  19. 'color' => ['type' => self::STR, 'maxLength' => 30, 'default' => false],
  20. 'shadow' => ['type' => self::UINT, 'maxLength' => 3, 'default' => 0],
  21. 'css' => ['type' => self::STR, 'maxLength' => 100, 'default' => false]
  22. ];
  23. $structure->getters = [];
  24. $structure->relations = [
  25. 'User' => [
  26. 'entity' => 'XF:User',
  27. 'type' => self::TO_ONE,
  28. 'conditions' => 'user_id',
  29. 'primary' => true
  30. ],
  31. ];
  32.  
  33. return $structure;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement