> > $joeBob = new myClass();
> > "myClass" can somehow know that "joeBob" is the name of
> > it's instance?
> > I'm thinking 'no', but would like verification.
> I'm not aware of a way to do so.  I'm curious why you'd want 
> to?  If you want to pass "joeBob" to the class you can do so as the 
> parameter of one of the methods.  

This is what I ended up doing.  Basically what I needed this for is
I've got a class that prints out a blurb of javascript and a "<form>".
I wanted to make it so that each instance of a class would work with
it's own data.  This would require that the name of the javascript
function and the name of the form be different for each class instance.
If I was able to get the name of the class, it would have been all good,
I wouldn't have needed to add another paramter to the constructor.
But since I cannot, I needed the additional paramter.

The class is actually kind of cool.  It sets up and executes the sorting
of table columns based on a mySQL query.  My problem was if I
needed to tables using 2 different queries, when I clicked on a column
heading in one table, it would try to sort that column in both classes,
both queries.  I got around this by adding the additional argument,
as I mentioned above.

> And my guess is that you already know, but if you want to refer to 
> a method or property of a class from within the class, you do using 
> syntax like $this->property_here.

Yes, I already knew. :P

Chris

Reply via email to