¡@

Home 

php Programming Glossary: getsomething

Global or Singleton for database connection?

http://stackoverflow.com/questions/130878/global-or-singleton-for-database-connection

complex. Code with Global conn new PDO ... function getSomething global conn . . . Code with Singleton class DB_Instance private.. if self db self db new PDO ... return self db function getSomething conn DB_Instance getDBO . . . If there's a better way of initializing.. getConnection if db db new PDO ... return db function getSomething conn ConnectionFactory getFactory getConnection . . . Then in..

PHP function - ignore some default parameters [duplicate]

http://stackoverflow.com/questions/9541776/php-function-ignore-some-default-parameters

across this. If I have a function like so public function getSomething orderBy 'x' direction 'DESC' limit null do something random.. yet specify the 3rd. For example random this my_model getSomething USE_DEFAULT USE_DEFAULT 10 I know I can pass the 1st and 2nd.. that a default value should be used public function getSomething orderBy null direction null limit null fallbacks if orderBy..