Sales.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. /**
  3. *
  4. * PHP Pro Bid $Id$ o7sbe8CfJji4DIa8b0Lloyp/chIXnE+At24rYq22Ha0=
  5. *
  6. * @link http://www.phpprobid.com
  7. * @copyright Copyright (c) 2014 Online Ventures Software LTD & CodeCube SRL
  8. * @license http://www.phpprobid.com/license Commercial License
  9. *
  10. * @version 7.0
  11. */
  12. namespace Ppb\Db\Table;
  13. use Cube\Db\Table\AbstractTable;
  14. class Sales extends AbstractTable
  15. {
  16. /**
  17. *
  18. * table name
  19. *
  20. * @var string
  21. */
  22. protected $_name = 'sales';
  23. /**
  24. *
  25. * primary key
  26. *
  27. * @var string
  28. */
  29. protected $_primary = 'id';
  30. /**
  31. *
  32. * class name for row
  33. *
  34. * @var string
  35. */
  36. protected $_rowClass = '\Ppb\Db\Table\Row\Sale';
  37. /**
  38. * class name for rowset
  39. *
  40. * @var string
  41. */
  42. protected $_rowsetClass = '\Ppb\Db\Table\Rowset\Sales';
  43. /**
  44. *
  45. * reference map
  46. *
  47. * @var array
  48. */
  49. protected $_referenceMap = array(
  50. 'Buyer' => array(
  51. self::COLUMNS => 'buyer_id',
  52. self::REF_TABLE_CLASS => '\Ppb\Db\Table\Users',
  53. self::REF_COLUMNS => 'id',
  54. ),
  55. 'Seller' => array(
  56. self::COLUMNS => 'seller_id',
  57. self::REF_TABLE_CLASS => '\Ppb\Db\Table\Users',
  58. self::REF_COLUMNS => 'id',
  59. ),
  60. 'BillingAddress' => array(
  61. self::COLUMNS => 'billing_address_id',
  62. self::REF_TABLE_CLASS => '\Ppb\Db\Table\UsersAddressBook',
  63. self::REF_COLUMNS => 'id',
  64. ),
  65. 'ShippingAddress' => array(
  66. self::COLUMNS => 'shipping_address_id',
  67. self::REF_TABLE_CLASS => '\Ppb\Db\Table\UsersAddressBook',
  68. self::REF_COLUMNS => 'id',
  69. ),
  70. 'Messaging' => array(
  71. self::COLUMNS => 'messaging_topic_id',
  72. self::REF_TABLE_CLASS => '\Ppb\Db\Table\Messaging',
  73. self::REF_COLUMNS => 'topic_id',
  74. ),
  75. );
  76. /**
  77. *
  78. * dependent tables
  79. *
  80. * @var array
  81. */
  82. protected $_dependentTables = array(
  83. '\Ppb\Db\Table\SalesListings',
  84. '\Ppb\Db\Table\Transactions',
  85. '\Ppb\Db\Table\Messaging',
  86. '\Ppb\Db\Table\Accounting',
  87. );
  88. }