Incam_IntranetNueva/www/protected/gii/fixture/templates/default/fixture.php
2012-01-31 17:42:47 +00:00

20 lines
538 B
PHP

<?php
$n = 0;
echo '<?php' . PHP_EOL;
echo 'return array(' . PHP_EOL;
if(isset($models))
foreach ($models as $model){
echo '\''.get_class($model).'_'. ++$n . '\' => array(' . PHP_EOL ;
foreach ($model->attributes as $attr => $value){
echo "\t'" . str_replace("'", "\'", $attr) . "' =>";
if(isset($value)){
echo "'" . str_replace("'", "\'", $value) . "',\n";
}else{
echo "NULL,\n";
}
}
echo '),'.PHP_EOL;
}
echo ');';