| View previous topic :: View next topic |
| Author |
Message |
Shu
Joined: 07 Jul 2009 Posts: 2
|
Posted: Tue Jul 07, 2009 8:32 am Post subject: Singleton & Autocomplete |
|
|
Hello,
I usually use a Singleton class Database but self-complete seems buggy
Are there plans to fix it? Is there a solution?
example :
| Code: |
class Database {
static $instance;
private function __construct() {
...
}
public static function getInstance() {
if (!isset(self::$instance)) {
self::$instance = new Database;
}
return self::$instance;
}
public function select() {
...
}
}
$db = Database::getInstance();
$db->[ctrl-space => no result]
|
|
|
| Back to top |
|
 |
Tomas Mysik Posted via mailing list.
|
Posted: Tue Jul 07, 2009 9:32 am Post subject: Singleton & Autocomplete |
|
|
Hi,
Dne úterý 07 července 2009 10:32:09 Shu napsal(a):
| Quote: | I usually use a Singleton class Database but self-complete seems buggy
Are there plans to fix it? Is there a solution?
example :
Code:
class Database {
static $instance;
private function __construct() {
...
}
public static function getInstance() {
if (!isset(self::$instance)) {
self::$instance = new Database;
}
return self::$instance;
}
public function select() {
...
}
}
$db = Database::getInstance();
$db->[ctrl-space => no result]
|
you are missing PHPDoc tags for your class (NetBeans uses them for code
completion).
Tomas
[1] http://manual.phpdoc.org/
--
Tomas Mysik
address-removed |
|
| Back to top |
|
 |
Shu
Joined: 07 Jul 2009 Posts: 2
|
Posted: Tue Jul 07, 2009 9:48 am Post subject: Re: Singleton & Autocomplete |
|
|
| Tomas Mysik wrote: |
you are missing PHPDoc tags for your class (NetBeans uses them for code
completion).
|
| Code: |
/**
* @static
* @return Database
*/
public static function GetInstance() {
if (!isset(self::$instance)) {
self::$instance = new Database;
}
return self::$instance;
}
|
Work like a charm
Ty for this cool IDE and your fast support  |
|
| Back to top |
|
 |
Tomas Mysik Posted via mailing list.
|
Posted: Tue Jul 07, 2009 10:56 am Post subject: Singleton & Autocomplete |
|
|
Hi,
Dne úterý 07 července 2009 11:49:07 Shu napsal(a):
| Quote: | Work like a charm [Laughing]
|
great to hear!
| Quote: | Ty for this cool IDE and your fast support
|
You're welcome.
Tomas
--
Tomas Mysik
address-removed |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|