Sorry this is the right one:

----------------------------------------------------------------------
function __buildUpSchema($tableName) {

        $useTable = low(Inflector::pluralize($tableName));

                $db =& ConnectionManager::getDataSource($this->_useDbConfig);

                loadModel();
                //strip tablePrefix if exists
        $tbPrefix = $db->config['prefix'];
        $myTab = substr_replace($tableName, '', 0,
strlen($tbPrefix));
        //---------------------------
        $tempModel = new Model(false, $myTab);
                $modelFields = $db->describe($tempModel);
                foreach($modelFields as $key=>$item){
                    if($key!='id' AND $key!='created' AND $key!='modified'){
                        $default = !empty($item['default']) ? $item['default'] :
'false';

                        $setNull = $item['null']==true ? 'is_null' : 'not_null';

                        $tempFieldSchema[$key] = array('type'=>$item['type'],
                                                       'default'=>$default,
                                                       
'length'=>$item['length'],
                                                      );
                        //let's set the option NULL
field
                        $tempFieldSchema [$key][] = $setNull;
                        $tableSchema = $tempFieldSchema;
                    }
                }
                if(!array_key_exists('id', $modelFields)){
                    $tableSchema[] = 'no_id';
                }
                if(!array_key_exists('created', $modelFields)){
                    $tableSchema[] = 'no_dates';
                }

        return $tableSchema;
        }
----------------------------------------------------------------------

Anyway I'll now update YAMMY to version 1.1


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to