Created
June 5, 2012 09:32
-
-
Save Ph3nol/2873885 to your computer and use it in GitHub Desktop.
List a symfony 1.4 project models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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