public function __construct($adapter, $name, $options = array())
{
//sanity check
if (!$adapter instanceof Ruckusing_Adapter_MySQL_Base) {
throw new Ruckusing_Exception("Invalid MySQL Adapter instance.", Ruckusing_Exception::INVALID_ADAPTER);
}
if (!$name) {
throw new Ruckusing_Exception("Invalid 'name' parameter", Ruckusing_Exception::INVALID_ARGUMENT);
}
$this->_adapter = $adapter;
$this->_name = $name;
$this->_options = $options;
$this->init_sql($name, $options);
$this->_table_def = new Ruckusing_Adapter_TableDefinition($this->_adapter, $this->_options);
if (array_key_exists('id', $options)) {
if (is_bool($options['id']) && $options['id'] == false) {
$this->_auto_generate_id = false;
}
//if its a string then we want to auto-generate an integer-based
//primary key with this name
if (is_string($options['id'])) {
$this->_auto_generate_id = true;
$this->_primary_keys[] = $options['id'];
}
}
}