TableBugsCustom.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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-2008 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. PHPUnit_Util_Filter::addFileToFilter(__FILE__);
  30. /**
  31. * @category Zend
  32. * @package Zend_Db
  33. * @subpackage UnitTests
  34. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  35. * @license http://framework.zend.com/license/new-bsd New BSD License
  36. */
  37. class My_ZendDbTable_TableBugsCustom extends My_ZendDbTable_TableBugs
  38. {
  39. public $isMetadataFromCache = false;
  40. protected $_metadataCacheInClass = false;
  41. protected $_rowClass = 'My_ZendDbTable_Row_TestMyRow';
  42. protected $_rowsetClass = 'My_ZendDbTable_Rowset_TestMyRowset';
  43. protected $_dependentTables = array('My_ZendDbTable_TableBugsProductsCustom');
  44. protected $_referenceMap = array(
  45. 'Reporter' => array(
  46. 'columns' => array('reported_by'),
  47. 'refTableClass' => 'My_ZendDbTable_TableAccountsCustom',
  48. 'refColumns' => array('account_name'),
  49. 'onDelete' => self::CASCADE,
  50. 'onUpdate' => self::CASCADE
  51. ),
  52. 'Engineer' => array(
  53. 'columns' => 'assigned_to',
  54. 'refTableClass' => 'My_ZendDbTable_TableAccountsCustom',
  55. 'refColumns' => 'account_name'
  56. ),
  57. 'Verifier' => array(
  58. 'columns' => 'verified_by',
  59. 'refTableClass' => 'My_ZendDbTable_TableAccountsCustom',
  60. 'refColumns' => 'account_name'
  61. )
  62. );
  63. /**
  64. * Public proxy to setup functionality
  65. *
  66. * @return void
  67. */
  68. public function setup()
  69. {
  70. $this->_setup();
  71. }
  72. /**
  73. * Turnkey for initialization of a table object.
  74. *
  75. * @return void
  76. */
  77. protected function _setup()
  78. {
  79. $this->_setupDatabaseAdapter();
  80. $this->_setupTableName();
  81. $this->isMetadataFromCache = $this->_setupMetadata();
  82. $this->_setupPrimaryKey();
  83. }
  84. }