473,624 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Do you use _set?

i don't like the magic function because it limits the ability
for ide to list all the class variables.

ss
Sep 30 '07 #1
3 3654
I never use set. I create my own functions that deal only with their
piece of variables.

Sep 30 '07 #2
..oO(news.telus .net)
>i don't like the magic function because it limits the ability
for ide to list all the class variables.
I don't use __set() at the moment, but its counterpart __get(). In my
own component framework it makes it very convenient to directly access
subcomponents without having to explicitly call a function everytime:

Without magic:

$foo->getComponentBy Id('this')->getComponentBy Id('that')->doSomething( );

With magic:

$foo->this->that->doSomething( );

Micha
Sep 30 '07 #3
$foo->this->that->doSomething( );
The thing I don't like about is in IDE "this" and "that" are not going to be
in the autocomplete list. I just don't like to go back and forth
btwn class files.( maybe only me ..)

Most of people working with php don't use ide?

When i work with java in eclipse, it gives you option to "generate setter
and getter"
with class variables selected. Within PDT, i don't get the feature( i guess
i have to make one by myself )


Oct 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2020
by: Peter Fox | last post by:
<?php /* Making up class properties on the fly! -------------------------------------- PHP version 4.3.5 An instance of a class can have properties added on the fly. This behaviour tripped me up when I got my objects a bit mixed up
3
2244
by: michael | last post by:
Hello again, I have a dictionary with the following content : 'LZ': {'type': 'N', 'bytes': '00008'}, 'LVI000': {'type': 'N', 'bytes': '000010'} This could be seen as a interface description to deal with an external program that needs a 18 Byte communication area. 8 and 18 Bytes have to be interpreted as a "Number" String representation. eg like
11
1613
by: Laszlo Zsolt Nagy | last post by:
My problem is about properties and the virtuality of the methods. I would like to create a property whose get and set methods are virtual. I had the same problems in Delphi before and the solution was the same. I created a private _get method and a public get method. The former one will call the latter. The same stands for _set and set. Here is an example below: class C1(object): def namechanged(self): """Called after the name of the...
2
1552
by: Gianguz | last post by:
I'd like to discuss about the opportunity to have a global objects creator that introduces into a general framework (suited for multithreading) a controlled semantic to manage globals variables (objects and scalar-types). In the following example Global is able to create objects of any kind with and index value attached to. So a Global<0, string> is a unique string instance object allocated into the system that can be accessed from any...
5
3145
by: Ingo Nolden | last post by:
Hi there, I am writing a smart pointer that is similar to the boost intrusive ptr. I am trying to make it behave like a c++ pointer including the implicit and explicit casting behaviour. Below is the part more or less relevant to my problem. Version 1 is fine for casting to a derived class, but it must be called explicitly even though it is used to cast to a base class.
1
2108
by: gianguz | last post by:
In the following example Global is able to create and manage access to objects of any kind (even in a multithreading environment) with and index value attached to. So a Global<0, string> is a unique string instance object allocated into the system that can be accessed from any point into the program simply 'creating' another instance of Global<int, T> with the same id and type.Like globals, destruction of these objects is delegated until...
17
1938
by: Lee Harr | last post by:
I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm)
7
1359
mickey0
by: mickey0 | last post by:
hello, I wrote this but it doens't compile; more or less I see the error; I have to include "pattern.h" instead of "class Pattern" in patternset.h; But I don't understand why: This is the error: error C2027: use of undefined type 'Pattern' see declaration of 'Pattern' error C2227: left of '->getValues' must point to class/struct/union/generic type and this the code: //main.cpp
1
475
by: Mirco Wahab | last post by:
Alf P. Steinbach wrote: No, there isn't any (afaik). You can look it up here: http://www.boost.org/doc/libs/1_35_0/doc/html/boost_tr1/unsupported.html#boost_tr1.unsupported.unordered_map Thanks & regards M.
0
8242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8681
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8629
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.