![]()  | 
	 
| Magic __get method and code complete | 
		
		
  | 
	Actually $_db is not $db and not getDb(), and due to their loose coupling the relation may be different from case to case. Tricking the IDE therefore is quite dangerous.
 
	However, you could at least make PhpED know about the accessable $db member during design time by using a workarround. I frequently use that concept for a simple Proxy Pattern or a smart base class which allows me to handle public members comfortably. Simplified for your case it looks like this: 
  | 
||||||||||||||
| 
	 | 
|||||||||||||||
| Magic __get method and code complete | 
		
		
  | 
	Hi once again!
 
	I've browsed internet a little, and found nice article regarding this subject: http://greg.chiaraquartet.net/archives/140-phpDocumentor-and-__get__set__call-give-us-your-ideas-RFC.html In two words, this article says, that I should place the following PhpDoc comments before class declaration (in terms of my task): 
 I tried so, but unfortunately nothing seem to happen. May anyone say whether this feature is supported by NuSphere PhpEd or not?[/code]  | 
||||||||||||||
| 
	 | 
|||||||||||||||
		
		
  | 
	Schnapo,
 
	Your solution looks reasonable, but is actual trick. I'll keep it in mind, but I still hope to find correct way, using phpDoc. Thanks for response.  | 
||||||||||||
| 
	 | 
|||||||||||||
		
		
  | 
	Well yes, for your application it is a quite dirty trick. It makes more sense in other situations like proxying or for adding advanced member management to classes. I use it for instance to add transactions at object level.
 
	I think a feature request ist required, for PhpED to recognize @property annotations.  | 
||||||||||||
| 
	 | 
|||||||||||||
| Magic __get method and code complete | 
		
		
  | 
	Schnapo, you may be interested. I've found solution, which doesn't force dev to modify class constructor and member list.
 
	It seem to be slightly buggy though, but I found a great usage for it... So the PhpDoc comment before class declaration should be: 
 What seems to be buggy, is that autocomplete on these properties cuts off first character of property. So the property in autocomplete will be just a letter "b". So this method is not the one you need, if you use variables of basic php types (such as integer, boolean, etc). But in the case, when this property is an object, Base::App()->db will display the code complete list for PDO class. That is pretty nice Hope, it may be useful for someone.  | 
||||||||||||||
| 
	 | 
|||||||||||||||
		
		
  | 
	I currently don't understand what you mean with "cuts off first character"... it works like a charm here. 
	 | 
||||||||||||
| 
	 | 
|||||||||||||
| Magic __get method and code complete | 
	
  | 
||
  
		 | 
	
	Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by


RSS2 Feed