TableBugsCustom.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Db
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * require other test files needed, this will
  24. * ensure that Zend_Loader::loadClass is not called
  25. */
  26. require_once 'TableBugs.php';
  27. require_once 'TableBugsProductsCustom.php';
  28. require_once 'TableAccountsCustom.php';
  29. /**
  30. * @category Zend
  31. * @package Zend_Db
  32. * @subpackage UnitTests
  33. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  34. * @license http://framework.zend.com/license/new-bsd New BSD License
  35. */
  36. class My_ZendDbTable_TableBugsCustom extends My_ZendDbTable_TableBugs
  37. {
  38. public $isMetadataFromCache = false;
  39. protected $_metadataCacheInClass = false;
  40. protected $_rowClass = 'My_ZendDbTable_Row_TestMyRow';
  41. protected $_rowsetClass = 'My_ZendDbTable_Rowset_TestMyRowset';
  42. protected $_dependentTables = array('My_ZendDbTable_TableBugsProductsCustom');
  43. protected $_referenceMap = array(
  44. 'Reporter' => array(
  45. 'columns' => array('reported_by'),
  46. 'refTableClass' => 'My_ZendDbTable_TableAccountsCustom',
  47. 'refColumns' => array('account_name'),
  48. 'onDelete' => self::CASCADE,
  49. 'onUpdate' => self::CASCADE
  50. ),
  51. 'Engineer' => array(
  52. 'columns' => 'assigned_to',
  53. 'refTableClass' => 'My_ZendDbTable_TableAccountsCustom',
  54. 'refColumns' => 'account_name'
  55. ),
  56. 'Verifier' => array(
  57. 'columns' => 'verified_by',
  58. 'refTableClass' => 'My_ZendDbTable_TableAccountsCustom',
  59. 'refColumns' => 'account_name'
  60. )
  61. );
  62. /**
  63. * Public proxy to setup functionality
  64. *
  65. * @return void
  66. */
  67. public function setup()
  68. {
  69. $this->_setup();
  70. }
  71. /**
  72. * Turnkey for initialization of a table object.
  73. *
  74. * @return void
  75. */
  76. protected function _setup()
  77. {
  78. $this->_setupDatabaseAdapter();
  79. $this->_setupTableName();
  80. $this->isMetadataFromCache = $this->_setupMetadata();
  81. $this->_setupPrimaryKey();
  82. }
  83. }