Schema_TableBase.php 664 B

123456789101112131415161718192021222324252627
  1. <?php
  2. // @docs in Schema_TableFactory
  3. class Schema_TableBase {
  4. public function __construct() {
  5. $this->_types = array();
  6. $this->initTypes();
  7. }
  8. public function initTypes() {// TODO: override
  9. // parent::initTypes();// always call parent method
  10. // example: $this->_types['WWW'] = 'p5:www_link';
  11. // TODO: $this->_types['WWW'] = new Type_Link($params = array('maxLength' => 255, ...));
  12. }
  13. public function fixTypes($types) {
  14. if (!is_array($this->_types)) return;
  15. foreach ($types as $fldName => $type) {
  16. if (array_key_exists($fldName, $this->_types)) {
  17. $types[$fldName]['simpleType'] = $this->_types[$fldName];
  18. }
  19. }
  20. return $types;
  21. }
  22. }