Development

Changeset 24641

You must first sign up to be able to contribute.

Changeset 24641

Show
Ignore:
Timestamp:
12/01/09 08:03:09 (5 years ago)
Author:
Jonathan.Wage
Message:

[1.4][sfDoctrine2Plugin] Updates for Doctrine 2 to make plugin work again

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/README

    r22846 r24641  
    5050 
    5151    [yml] 
    52     Models\User: 
     52    Entities\User: 
    5353      type: entity 
    5454      table: user 
     
    7272 
    7373    [yml] 
    74     Models\User: 
     74    Entities\User: 
    7575      type: entity 
    7676      table: user 
     
    9595 
    9696    [php] 
    97     $repository = $em->getRepository('Models\User'); 
     97    $repository = $em->getRepository('Entities\User'); 
    9898    $users = $repository->getActiveUsers(); 
    9999 
     
    101101 
    102102    [php] 
    103     $users = \Models\User::getActiveUsers(); 
     103    $users = \Entities\User::getActiveUsers(); 
    104104 
    105105In order to use the above syntax your `User` model needs to extend `sfDoctrineActiveEntity` 
     
    107107 
    108108    [php] 
    109     namespace Models; 
     109    namespace Entities; 
    110110 
    111111    use sfDoctrineActiveEntity; 
     
    126126    $em = $this->getEntityManager(); 
    127127 
    128     $admin = new \Models\User(); 
     128    $admin = new \Entities\User(); 
    129129    $admin->username = 'admin'; 
    130130    $admin->password = 'changeme'; 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/config/sfDoctrine2PluginConfiguration.class.php

    r22777 r24641  
    4747    $classLoader->register(); 
    4848 
    49     $classLoader = new \Doctrine\Common\IsolatedClassLoader('Models'); 
    50     $classLoader->setBasePath(sfConfig::get('sf_lib_dir').'/models'); 
     49    $classLoader = new \Doctrine\Common\IsolatedClassLoader('Entities'); 
     50    $classLoader->setBasePath(sfConfig::get('sf_lib_dir').'/entities/doctrine'); 
    5151    $classLoader->register(); 
    5252 
     
    8585    else if ($method == 'getEntityManagerFor') 
    8686    { 
     87      $entityName = $args[0]; 
     88      if (is_object($entityName)) 
     89      { 
     90        $entityName = get_class($entityName); 
     91      } 
    8792      $databaseManager = $actions->getContext()->getDatabaseManager(); 
    8893      $names = $databaseManager->getNames(); 
     
    9196        $em = $databaseManager->getDatabase($name)->getEntityManager(); 
    9297        $cmf = $em->getMetadataFactory(); 
    93         if ($cmf->hasMetadataFor($args[0])) 
     98        if ($cmf->hasMetadataFor($entityName)) 
    9499        { 
    95100          $event->setReturnValue($em); 
     
    101106    else if ($method == 'getMetadataFor') 
    102107    { 
     108      $entityName = $args[0]; 
     109      if (is_object($entityName)) 
     110      { 
     111        $entityName = get_class($entityName); 
     112      } 
    103113      $databaseManager = $actions->getContext()->getDatabaseManager(); 
    104114      $names = $databaseManager->getNames(); 
     
    107117        $em = $databaseManager->getDatabase($name)->getEntityManager(); 
    108118        $cmf = $em->getMetadataFactory(); 
    109         if ($cmf->hasMetadataFor($args[0])) 
     119        if ($cmf->hasMetadataFor($entityName)) 
    110120        { 
    111           $event->setReturnValue($cmf->getMetadataFor($args[0])); 
     121          $event->setReturnValue($cmf->getMetadataFor($entityName)); 
    112122          return true; 
    113123        } 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/data/generator/sfDoctrineModule/admin/parts/configuration.php

    r22776 r24641  
    2626  } 
    2727 
    28   public function getForm($object = null
     28  public function getForm($object = null, $options = array()
    2929  { 
    3030    $class = $this->getFormClass(); 
     
    3737    $this->em = $em; 
    3838  } 
     39 
     40  public function getEntityManager() 
     41  { 
     42    return $this->em; 
     43  } 
    3944 
    4045  public function hasFilterForm() 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/data/generator/sfDoctrineModule/admin/parts/deleteAction.php

    r22764 r24641  
    55    $this->dispatcher->notify(new sfEvent($this, 'admin.delete_object', array('object' => $this->getRoute()->getObject()))); 
    66 
    7     if ($this->getRoute()->getObject()->delete()) 
    8     { 
    9       $this->getUser()->setFlash('notice', 'The item was deleted successfully.'); 
    10     } 
     7    $object = $this->getRoute()->getObject(); 
     8    $object->delete(); 
     9    $this->getEntityManagerFor($object)->flush(); 
     10    $this->getUser()->setFlash('notice', 'The item was deleted successfully.'); 
    1111 
    1212    $this->redirect('@<?php echo $this->getUrlForAction('list') ?>'); 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/data/generator/sfDoctrineModule/admin/parts/filterAction.php

    r22764 r24641  
    2020    } 
    2121 
    22     $this->pager = $this->getPager(); 
     22    $this->pager = $this->getPager('<?php echo $this->getModelClass() ?>'); 
    2323    $this->sort = $this->getSort(); 
    2424 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/data/generator/sfDoctrineModule/admin/parts/indexAction.php

    r22764 r24641  
    1313    } 
    1414 
    15     $this->pager = $this->getPager(); 
     15    $this->pager = $this->getPager('<?php echo $this->getModelClass() ?>'); 
    1616    $this->sort = $this->getSort(); 
    1717  } 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/data/generator/sfDoctrineModule/admin/parts/paginationAction.php

    r22776 r24641  
    1   protected function getPager(
     1  public function getPager($model
    22  { 
    3     $pager = $this->configuration->getPager($this->getEntityManagerFor('<?php echo $this->getModelClass() ?>'), '<?php echo $this->getModelClass() ?>'); 
     3    $pager = $this->configuration->getPager($this->getEntityManagerFor($model), '<?php echo $this->getModelClass() ?>'); 
    44    $pager->setQuery($this->buildQuery()); 
    55    $pager->setPage($this->getPage()); 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/data/generator/sfDoctrineModule/admin/parts/paginationConfiguration.php

    r22776 r24641  
    1   public function getPager($em, $model) 
     1  public function getPager($model) 
    22  { 
     3    $em = $this->getEntityManager(); 
    34    $class = $this->getPagerClass(); 
    45 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/data/generator/sfDoctrineModule/admin/template/templates/_list_td_batch_actions.php

    r22764 r24641  
    11<td> 
    2   <input type="checkbox" name="ids[]" value="[?php echo $<?php echo $this->getSingularName() ?>->getPrimaryKey() ?]" class="sf_admin_batch_checkbox" /> 
     2  <input type="checkbox" name="ids[]" value="[?php echo current($<?php echo $this->getSingularName() ?>->obtainIdentifier()) ?]" class="sf_admin_batch_checkbox" /> 
    33</td> 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/cli/sfDoctrineCliPrinter.class.php

    r22886 r24641  
    11<?php 
    22 
    3 use Doctrine\ORM\Tools\Cli\Printers\AnsiColorPrinter; 
     3use Doctrine\Common\Cli\Printers\AnsiColorPrinter; 
    44 
    55class sfDoctrineCliPrinter extends AnsiColorPrinter 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/form/sfFormDoctrine.class.php

    r22778 r24641  
    8585 
    8686  /** 
    87    * Returns the current model name. 
    88    */ 
    89   abstract public function getModelName(); 
    90  
    91   /** 
    9287   * Returns true if the current form embeds a new object. 
    9388   * 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/generator/sfDoctrineFormFilterGenerator.class.php

    r22776 r24641  
    9292      } 
    9393 
    94       $path = $baseDir.'/base/Base'.$this->modelName.'FormFilter.class.php'; 
    95       $path = str_replace('\\', '', $path); 
     94      $path = $baseDir.'/base/Base'.str_replace('\\', '', $this->modelName).'FormFilter.class.php'; 
    9695      $dir = dirname($path); 
    9796      if (!is_dir($dir)) 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/generator/sfDoctrineFormGenerator.class.php

    r22778 r24641  
    3535   * @var array 
    3636   */ 
    37   public $pluginModels = array(); 
     37  public $pluginEntities = array(); 
    3838 
    3939  public $databaseManager; 
     
    125125      } 
    126126 
    127       $path = $baseDir.'/base/Base'.$metadata->name.'Form.class.php'; 
    128       $path = str_replace('\\', '', $path); 
     127      $path = $baseDir.'/base/Base'.str_replace('\\', '', $metadata->name).'Form.class.php'; 
    129128      $dir = dirname($path); 
    130129      if (!is_dir($dir)) 
     
    172171   * @todo This method is ugly and is a very weird way of finding the models which  
    173172   *       belong to plugins. If we could come up with a better way that'd be great 
    174    * @return array $pluginModel
    175    */ 
    176   public function getPluginModels() 
    177   { 
    178     if (!$this->pluginModels) 
     173   * @return array $pluginEntitie
     174   */ 
     175  public function getPluginEntities() 
     176  { 
     177    if (!$this->pluginEntities) 
    179178    { 
    180179      $plugins     = $this->generatorManager->getConfiguration()->getPlugins(); 
     
    200199            if ($reflection->isSubClassOf($parent)) 
    201200            { 
    202               $this->pluginModels[$modelName] = $pluginName; 
     201              $this->pluginEntities[$modelName] = $pluginName; 
    203202              $generators = Doctrine::getTable($modelName)->getGenerators(); 
    204203              foreach ($generators as $generator) 
    205204              { 
    206                 $this->pluginModels[$generator->getOption('className')] = $pluginName; 
     205                $this->pluginEntities[$generator->getOption('className')] = $pluginName; 
    207206              } 
    208207            } 
     
    212211    } 
    213212 
    214     return $this->pluginModels; 
     213    return $this->pluginEntities; 
    215214  } 
    216215 
     
    223222  public function isPluginModel($modelName) 
    224223  { 
    225     return isset($this->pluginModels[$modelName]) ? true:false; 
     224    return isset($this->pluginEntities[$modelName]) ? true:false; 
    226225  } 
    227226 
     
    236235    if ($this->isPluginModel($modelName)) 
    237236    { 
    238       return $this->pluginModels[$modelName]; 
     237      return $this->pluginEntities[$modelName]; 
    239238    } else { 
    240239      return false; 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/generator/sfDoctrineGenerator.class.php

    r24639 r24641  
    313313    return sfInflector::underscore($name); 
    314314  } 
     315 
     316  public function camelize($name) 
     317  { 
     318    $name = str_replace('\\', '_', $name); 
     319    $name = sfInflector::camelize($name); 
     320    return strtolower($name[0]).substr($name, 1); 
     321  } 
     322 
     323  public function getSingularName() 
     324  { 
     325    return isset($this->params['singular']) ? $this->params['singular'] : $this->camelize($this->getModelClass()); 
     326  } 
    315327} 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/sfDoctrineDatabase.class.php

    r24638 r24641  
    4545    } 
    4646 
     47    $paths[] = realpath(__DIR__ . '/../config/doctrine'); 
     48 
    4749    $enabledPlugins = $configuration->getPlugins(); 
    4850    foreach ($configuration->getAllPluginPaths() as $plugin => $path) 
     
    5456      $paths[] = $path.'/config/doctrine'; 
    5557    } 
    56     $paths[] = realpath(__DIR__.'/../config/doctrine'); 
    5758    $paths = array_unique($paths); 
    5859 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBaseTask.class.php

    r22886 r24641  
    5252 
    5353    $args = array_merge($args, $arguments); 
    54     if ($em) 
    55     { 
    56       $args[] = '--config='.__DIR__.'/../../config/cli-config.php'; 
    57     } 
     54    $args[] = '--config='.__DIR__.'/../../config/cli-config.php'; 
    5855 
    5956    $printer = new sfDoctrineCliPrinter(); 
    6057    $printer->setFormatter($this->formatter); 
    6158 
    62     $cli = new \Doctrine\ORM\Tools\Cli($printer); 
     59    $cli = new \Doctrine\ORM\Tools\Cli\CliController(); 
    6360    $cli->run($args); 
    6461  } 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildModelTask.class.php

    r22778 r24641  
    7373    $opts['from'][] = sfConfig::get('sf_config_dir').'/doctrine'; 
    7474    $opts['to'] = 'annotation'; 
    75     $opts['dest'] = sfConfig::get('sf_lib_dir').'/models'; 
     75    $opts['dest'] = sfConfig::get('sf_lib_dir').'/entities/doctrine'; 
    7676 
    7777    $task = new sfDoctrineConvertMappingTask($this->dispatcher, $this->formatter); 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineLoadDataFixturesTask.class.php

    r22762 r24641  
    8989          { 
    9090            $this->logSection('doctrine', sprintf('Truncating "%s"', $class->name)); 
    91             $em->createQuery('DELETE FROM '.$class->name)->execute(); 
     91            try { 
     92              $em->createQuery('DELETE FROM '.$class->name)->execute(); 
     93            } catch (Exception $e) {} 
    9294          } 
    9395        } 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/bootstrap/cleanup.php

    r22762 r24641  
    22function cleanup() 
    33{ 
    4   sfToolkit::clearDirectory(dirname(__FILE__).'/../fixtures/project/cache'); 
     4  //sfToolkit::clearDirectory(dirname(__FILE__).'/../fixtures/project/cache'); 
    55  sfToolkit::clearDirectory(dirname(__FILE__).'/../fixtures/project/log'); 
    66 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/apps/frontend/config/routing.yml

    r22778 r24641  
    22  class: sfDoctrineRouteCollection 
    33  options: 
    4     model:                Models\User 
     4    model:                Entities\User 
    55    module:               users 
    66    prefix_path:          users 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/apps/frontend/modules/users/config/generator.yml

    r22778 r24641  
    22  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:           Models\User 
     4    model_class:           Entities\User 
    55    theme:                 admin 
    66    non_verbose_templates: true 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/config/ProjectConfiguration.class.php

    r22762 r24641  
    33if (!isset($_SERVER['SYMFONY'])) 
    44{ 
    5   $_SERVER['SYMFONY'] = '/Users/jwage/Sites/symfonysvn/1.3/lib'; 
     5  $_SERVER['SYMFONY'] = '/Users/jwage/Sites/symfonysvn/1.4/lib'; 
    66} 
    77 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/config/databases.yml

    r22778 r24641  
    1212      plugins: ~ 
    1313      options: 
    14         driver: pdo_sqlite 
    15         path: %SF_DATA_DIR%/test2.sqlite 
    16         #driver: pdo_mysql 
    17         #user: root 
    18         #dbname: sfdoctrine2 
     14        #driver: pdo_sqlite 
     15        #path: %SF_DATA_DIR%/test2.sqlite 
     16        driver: pdo_mysql 
     17        user: root 
     18        dbname: sfdoctrine2 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/config/doctrine/schema.yml

    r22778 r24641  
    1 Models\User: 
     1Entities\User: 
    22  type: entity 
    33  table: user 
     
    2323  oneToOne: 
    2424    profile: 
    25       targetEntity: Models\Profile 
     25      targetEntity: Entities\Profile 
    2626      mappedBy: user 
    2727  manyToMany: 
    2828    groups: 
    29       targetEntity: Models\Group 
     29      targetEntity: Entities\Group 
    3030      joinTable: 
    3131        name: user_group 
     
    3737            referencedColumnName: id 
    3838    friendsWithMe: 
    39       targetEntity: Models\User 
     39      targetEntity: Entities\User 
    4040      mappedBy: myFriends 
    4141    myFriends: 
    42       targetEntity: Models\User 
     42      targetEntity: Entities\User 
    4343      joinTable: 
    4444        name: friends 
     
    5050            referencedColumnName: id 
    5151 
    52 Models\Profile: 
     52Entities\Profile: 
    5353  type: entity 
    5454  table: profile 
     
    6868      type: string 
    6969      length: 255 
    70     userId: 
    71       column: user_id 
    72       type: integer 
    7370  oneToOne: 
    7471    user: 
    75       targetEntity: Models\User 
     72      targetEntity: Entities\User 
    7673      joinColumn: 
    7774        name: user_id 
    7875        fieldName: userId 
    7976        referencedColumnName: id 
     77        onDelete: CASCADE 
    8078 
    81 Models\Group: 
     79Entities\Group: 
    8280  type: entity 
    8381  table: groups 
     
    9391  manyToMany: 
    9492    users: 
    95       targetEntity: Models\User 
     93      targetEntity: Entities\User 
    9694      mappedBy: groups 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/data/fixtures/fixtures.php

    r22778 r24641  
    33$em = $this->getEntityManager(); 
    44 
    5 $admin = new \Models\User(); 
     5$admin = new \Entities\User(); 
     6$admin->isActive = true; 
    67$admin->username = 'admin'; 
    78$admin->password = 'changeme'; 
    89 
    9 $jwage = new \Models\User(); 
     10$jwage = new \Entities\User(); 
     11$jwage->isActive = true; 
    1012$jwage->username = 'jwage'; 
    1113$jwage->password = 'changeme'; 
    1214 
    13 $profile = new \Models\Profile(); 
     15$profile = new \Entities\Profile(); 
     16$profile->isActive = true; 
    1417$profile->firstName = 'Jonathan'; 
    1518$profile->lastName = 'Wage'; 
     
    1720$profile->user = $jwage; 
    1821 
    19 $group = new \Models\Group(); 
     22$group = new \Entities\Group(); 
    2023$group->name = 'Admin'; 
    2124$group->addUsers($jwage); 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/filter/doctrine/ModelsGroupFormFilter.class.php

    r22764 r24641  
    22 
    33/** 
    4  * ModelsGroup filter form. 
     4 * EntitiesGroup filter form. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class ModelsGroupFormFilter extends BaseModelsGroupFormFilter 
     11class EntitiesGroupFormFilter extends BaseEntitiesGroupFormFilter 
    1212{ 
    1313  public function configure() 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/filter/doctrine/ModelsProfileFormFilter.class.php

    r22764 r24641  
    22 
    33/** 
    4  * ModelsProfile filter form. 
     4 * EntitiesProfile filter form. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class ModelsProfileFormFilter extends BaseModelsProfileFormFilter 
     11class EntitiesProfileFormFilter extends BaseEntitiesProfileFormFilter 
    1212{ 
    1313  public function configure() 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/filter/doctrine/ModelsUserFormFilter.class.php

    r22764 r24641  
    22 
    33/** 
    4  * ModelsUser filter form. 
     4 * EntitiesUser filter form. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class ModelsUserFormFilter extends BaseModelsUserFormFilter 
     11class EntitiesUserFormFilter extends BaseEntitiesUserFormFilter 
    1212{ 
    1313  public function configure() 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/filter/doctrine/base/BaseModelsGroupFormFilter.class.php

    r22776 r24641  
    22 
    33/** 
    4  * ModelsGroup filter form base class. 
     4 * EntitiesGroup filter form base class. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class BaseModelsGroupFormFilter extends BaseFormFilterDoctrine 
     11class BaseEntitiesGroupFormFilter extends BaseFormFilterDoctrine 
    1212{ 
    1313  public function setup() 
     
    3232  public function getModelName() 
    3333  { 
    34     return 'Models\Group'; 
     34    return 'Entities\Group'; 
    3535  } 
    3636 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/filter/doctrine/base/BaseModelsProfileFormFilter.class.php

    r22778 r24641  
    22 
    33/** 
    4  * ModelsProfile filter form base class. 
     4 * EntitiesProfile filter form base class. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class BaseModelsProfileFormFilter extends BaseFormFilterDoctrine 
     11class BaseEntitiesProfileFormFilter extends BaseFormFilterDoctrine 
    1212{ 
    1313  public function setup() 
     
    1616      'firstName' => new sfWidgetFormFilterInput(array('with_empty' => false)), 
    1717      'lastName'  => new sfWidgetFormFilterInput(array()), 
    18       'userId'    => new sfWidgetFormDoctrineChoice($this->em, array('model' => 'Models\User', 'add_empty' => true)), 
    19       'userId'    => new sfWidgetFormDoctrineChoice($this->em, array('model' => 'Models\User', 'add_empty' => true)), 
     18      'userId'    => new sfWidgetFormDoctrineChoice($this->em, array('model' => 'Entities\User', 'add_empty' => true)), 
     19      'userId'    => new sfWidgetFormDoctrineChoice($this->em, array('model' => 'Entities\User', 'add_empty' => true)), 
    2020    )); 
    2121 
     
    2323      'firstName' => new sfValidatorPass(array('required' => false)), 
    2424      'lastName'  => new sfValidatorPass(array('required' => false)), 
    25       'userId'    => new sfValidatorDoctrineChoice($this->em, array('required' => false, 'model' => 'Models\User', 'column' => 'userId')), 
    26       'userId'    => new sfValidatorDoctrineChoice($this->em, array('required' => false, 'model' => 'Models\User', 'column' => 'userId')), 
     25      'userId'    => new sfValidatorDoctrineChoice($this->em, array('required' => false, 'model' => 'Entities\User', 'column' => 'userId')), 
     26      'userId'    => new sfValidatorDoctrineChoice($this->em, array('required' => false, 'model' => 'Entities\User', 'column' => 'userId')), 
    2727    )); 
    2828 
     
    3838  public function getModelName() 
    3939  { 
    40     return 'Models\Profile'; 
     40    return 'Entities\Profile'; 
    4141  } 
    4242 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/filter/doctrine/base/BaseModelsUserFormFilter.class.php

    r22776 r24641  
    22 
    33/** 
    4  * ModelsUser filter form base class. 
     4 * EntitiesUser filter form base class. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class BaseModelsUserFormFilter extends BaseFormFilterDoctrine 
     11class BaseEntitiesUserFormFilter extends BaseFormFilterDoctrine 
    1212{ 
    1313  public function setup() 
     
    3636  public function getModelName() 
    3737  { 
    38     return 'Models\User'; 
     38    return 'Entities\User'; 
    3939  } 
    4040 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/form/doctrine/ModelsGroupForm.class.php

    r22765 r24641  
    22 
    33/** 
    4  * ModelsGroup form. 
     4 * EntitiesGroup form. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class ModelsGroupForm extends BaseModelsGroupForm 
     11class EntitiesGroupForm extends BaseEntitiesGroupForm 
    1212{ 
    1313  public function configure() 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/form/doctrine/ModelsProfileForm.class.php

    r22765 r24641  
    22 
    33/** 
    4  * ModelsProfile form. 
     4 * EntitiesProfile form. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class ModelsProfileForm extends BaseModelsProfileForm 
     11class EntitiesProfileForm extends BaseEntitiesProfileForm 
    1212{ 
    1313  public function configure() 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/form/doctrine/ModelsUserForm.class.php

    r22778 r24641  
    22 
    33/** 
    4  * ModelsUser form. 
     4 * EntitiesUser form. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class ModelsUserForm extends BaseModelsUserForm 
     11class EntitiesUserForm extends BaseEntitiesUserForm 
    1212{ 
    1313  public function configure() 
    1414  { 
    15     $profile = $this->object->profile ? $this->object->profile:new \Models\Profile(); 
     15    $profile = $this->object->profile ? $this->object->profile:new \Entities\Profile(); 
    1616    $this->object->profile = $profile; 
    1717    $profile->user = $this->object; 
    1818 
    19     $profileForm = new ModelsProfileForm($this->em, $profile); 
     19    $profileForm = new EntitiesProfileForm($this->em, $profile); 
    2020    $profileForm->useFields(array('firstName', 'lastName')); 
    2121    unset($profileForm['id']); 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/form/doctrine/base/BaseModelsGroupForm.class.php

    r22778 r24641  
    22 
    33/** 
    4  * ModelsGroup form base class. 
     4 * EntitiesGroup form base class. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class BaseModelsGroupForm extends BaseFormDoctrine 
     11class BaseEntitiesGroupForm extends BaseFormDoctrine 
    1212{ 
    1313  public function setup() 
     
    1919 
    2020    $this->setValidators(array( 
    21       'id'   => new sfValidatorDoctrineChoice($this->em, array('model' => 'Models\Group', 'column' => 'id', 'required' => false)), 
     21      'id'   => new sfValidatorDoctrineChoice($this->em, array('model' => 'Entities\Group', 'column' => 'id', 'required' => false)), 
    2222      'name' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 
    2323    )); 
     
    3434  public function getModelName() 
    3535  { 
    36     return 'Models\Group'; 
     36    return 'Entities\Group'; 
    3737  } 
    3838 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/form/doctrine/base/BaseModelsProfileForm.class.php

    r22778 r24641  
    22 
    33/** 
    4  * ModelsProfile form base class. 
     4 * EntitiesProfile form base class. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class BaseModelsProfileForm extends BaseFormDoctrine 
     11class BaseEntitiesProfileForm extends BaseFormDoctrine 
    1212{ 
    1313  public function setup() 
     
    1717      'firstName' => new sfWidgetFormInputText(array()), 
    1818      'lastName'  => new sfWidgetFormInputText(array()), 
    19       'userId'    => new sfWidgetFormDoctrineChoice($this->em, array('model' => 'Models\User', 'add_empty' => true)), 
    20       'userId'    => new sfWidgetFormDoctrineChoice($this->em, array('model' => 'Models\User', 'add_empty' => true)), 
     19      'userId'    => new sfWidgetFormDoctrineChoice($this->em, array('model' => 'Entities\User', 'add_empty' => true)), 
     20      'userId'    => new sfWidgetFormDoctrineChoice($this->em, array('model' => 'Entities\User', 'add_empty' => true)), 
    2121    )); 
    2222 
    2323    $this->setValidators(array( 
    24       'id'        => new sfValidatorDoctrineChoice($this->em, array('model' => 'Models\Profile', 'column' => 'id', 'required' => false)), 
     24      'id'        => new sfValidatorDoctrineChoice($this->em, array('model' => 'Entities\Profile', 'column' => 'id', 'required' => false)), 
    2525      'firstName' => new sfValidatorString(array('max_length' => 255)), 
    2626      'lastName'  => new sfValidatorString(array('max_length' => 255, 'required' => false)), 
    27       'userId'    => new sfValidatorDoctrineChoice($this->em, array('model' => 'Models\User', 'required' => false)), 
    28       'userId'    => new sfValidatorDoctrineChoice($this->em, array('model' => 'Models\User', 'required' => false)), 
     27      'userId'    => new sfValidatorDoctrineChoice($this->em, array('model' => 'Entities\User', 'required' => false)), 
     28      'userId'    => new sfValidatorDoctrineChoice($this->em, array('model' => 'Entities\User', 'required' => false)), 
    2929    )); 
    3030 
     
    4040  public function getModelName() 
    4141  { 
    42     return 'Models\Profile'; 
     42    return 'Entities\Profile'; 
    4343  } 
    4444 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/fixtures/project/lib/form/doctrine/base/BaseModelsUserForm.class.php

    r22778 r24641  
    22 
    33/** 
    4  * ModelsUser form base class. 
     4 * EntitiesUser form base class. 
    55 * 
    66 * @package    test 
     
    99 * @version    SVN: $Id$ 
    1010 */ 
    11 class BaseModelsUserForm extends BaseFormDoctrine 
     11class BaseEntitiesUserForm extends BaseFormDoctrine 
    1212{ 
    1313  public function setup() 
     
    2121 
    2222    $this->setValidators(array( 
    23       'id'       => new sfValidatorDoctrineChoice($this->em, array('model' => 'Models\User', 'column' => 'id', 'required' => false)), 
     23      'id'       => new sfValidatorDoctrineChoice($this->em, array('model' => 'Entities\User', 'column' => 'id', 'required' => false)), 
    2424      'isActive' => new sfValidatorBoolean(array('required' => false)), 
    2525      'username' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 
     
    3838  public function getModelName() 
    3939  { 
    40     return 'Models\User'; 
     40    return 'Entities\User'; 
    4141  } 
    4242 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/functional/ActionsTest.php

    r22776 r24641  
    3434  end()-> 
    3535  with('doctrine')->begin()-> 
    36     check($em, 'Models\User', $checkInfo)-> 
     36    check($em, 'Entities\User', $checkInfo)-> 
    3737  end()-> 
    3838  with('response')->begin()-> 
     
    6868    end()-> 
    6969    with('doctrine')->begin()-> 
    70       check($em, 'Models\User', $checkInfo)-> 
    71       check($em, 'Models\Profile', $info['models_user']['profile'])-> 
     70      check($em, 'Entities\User', $checkInfo)-> 
     71      check($em, 'Entities\Profile', $info['models_user']['profile'])-> 
    7272    end()-> 
    7373    with('response')->begin()-> 
  • plugins/sfDoctrinePlugin/branches/1.3-2.0/tests/unit/ActiveEntityTest.php

    r22781 r24641  
    88$t = new lime_test(1, new lime_output_color()); 
    99 
    10 $user = \Models\User::findOneByUsername('jwage'); 
     10$user = \Entities\User::findOneByUsername('jwage'); 
    1111$t->is($user->username, 'jwage');