Gunar,
I'm confused. Using ZF 0.2.0 and wimg's code, calling
Zend_Db_Table::getAdapter() would return a Zend_Db_Adapter_Pdo_Mysql object
wouldn't it? Calling quoteInto on this would use
Zend_Db_Adapter_Abstract::quoteInto(), who in turn calls
Zend_Db_Adapter_Abstract::quote(), who calls _connect(). So, at that point
the connection should be established shouldn't it? If this is not the case,
could someone explain it to me then?
Lee
On 12/6/06, Gunar Scholz <[EMAIL PROTECTED]> wrote:
wimg schrieb:
> This is in my bootstrap index.php :
> $db = Zend_Db::factory('PDO_MYSQL',$params);
> Zend::register('db',$db);
> Zend_Db_Table::setDefaultAdapter($db);
>
> Yet it doesn't work. I can't automatically access find, quoteIn or other
> functions, nor can I do :
> $db=$this->getAdapter();
> as that returns NULL
getAdapter() simply returns $this->_connection which is initially set to
null unless one of the methods calls _connect(). _connect() isn't
public, so you can't call it explicit. Not establishing the connection
immediately is intended. The connection will be established as late as
possible. Too late in this case and for some other cases. See i.e. the
workaround in http://framework.zend.com/issues/browse/ZF-147
Gunar