Development

Changeset 3960

You must first sign up to be able to contribute.

Changeset 3960

Show
Ignore:
Timestamp:
05/08/07 18:17:34 (1 year ago)
Author:
Jonathan.Wage
Message:

sfDoctrineCommentsPlugin?: Added configurability to schema.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrineCommentsPlugin/config/doctrine/schema.yml

    r3925 r3960  
    11<?php include('schemaConfig.php') ?> 
    22Comment:  
    3   tableName: sf_comment 
     3  tableName: <?php echo $config['schema']['comment_table_name']; ?> 
    44  options: 
    55    treeImpl: NestedSet 
     
    2020      type: integer 
    2121      size: 4 
    22       foreignClass: <?php echo $config['user_model']."\n" ?> 
    23       foreignReference: <?php echo $config['user_model_id']."\n" ?> 
     22      foreignClass: <?php echo $config['schema']['user_model']."\n" ?> 
     23      foreignReference: <?php echo $config['schema']['user_model_id']."\n" ?> 
    2424      localName: Comments 
    2525      foreignName: User 
  • plugins/sfDoctrineCommentsPlugin/config/doctrine/schemaConfig.php

    r3907 r3960  
    11<?php 
    2 $config = array('user_model'      =>  'User', 
    3                 'user_model_id'   =>  'id'); 
     2// Schema defaults 
     3$config['schema'] = array('comment_table_name'  =>  'sf_comment', 
     4                          'user_model'          =>  'User', 
     5                          'user_model_id'       =>  'id'); 
    46 
    57if( is_readable($config_file = sfConfig::get('sf_config_dir').'/sfDoctrineCommentsPlugin.yml') ) 
     
    911  if(isset($doctrine_comments_config['schema'])) 
    1012  { 
    11     $config = array_merge($config, $doctrine_comments_config['schema']); 
     13    $config = array_merge($config['schema'], $doctrine_comments_config['schema']); 
    1214  } 
    1315}