Skip to content

Instantly share code, notes, and snippets.

@Ph3nol
Created June 5, 2012 09:32
Show Gist options
  • Save Ph3nol/2873885 to your computer and use it in GitHub Desktop.
Save Ph3nol/2873885 to your computer and use it in GitHub Desktop.
List a symfony 1.4 project models
<?php
// List models
echo implode(', ', Doctrine::loadModels(sfConfig::get('sf_lib_dir') . '/model/'));
// List models without Base* ones
$models = array();
$loadedModels = Doctrine::loadModels(sfConfig::get('sf_lib_dir') . '/model/');
foreach ($loadedModels as $model)
{
if (substr($model, -5) != 'Table' && substr($model, 0, 4) != 'Base')
{
$models[] = $model;
}
}
echo implode(', ', $models);
// exit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment