Reply to Casting Objects Within Class?

Your name:

Reply:


Posted by petethebloke@googlemail.com on 10/03/07 11:47

I'm not sure how to ask for what I want, so I can't find it on Google.

I'll explain.....

I have a class 'hanging' with a constructor:

class hanging{
function hanging(){
}

}

//and a class curtain
class curtain extends hanging{
function curtain(){
}

}

//and a blind
class blind extends hanging{
function blind(){
}

}

In the hanging constructor the object gets database info part of which
has an ID number for its type, so I want the constructor to have
something like....

function hanging(){
//blah blah
if ( type_ID is curtain ){
$this-> is a curtain object
}
//etc etc

}

But I don't know how. Any help would be appreciated.

Thanks

Pete

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация