Zend_Registry - Do you need getInstance() ?

Posted by Jesse on Stack Overflow See other posts from Stack Overflow or by Jesse
Published on 2010-04-22T21:13:17Z Indexed on 2010/04/22 21:23 UTC
Read the original article Hit count: 150

Hey I'm wondering when accessing Zend_Registry in an application if you need to include getInstance() and if so, why?

for example

    Zend_Registry::getInstance()->get('db');

vs.

    Zend_Registry::get('db');

they both seem to work with the later being less verbose. I vaguely understand that Zend_Registry is a singleton, which I think means there can only be one instance of it? so why would you need getInstance()?

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about registry