Re: array and a class
| From: | Pafo | Date: | Sat, 17 Aug 2002 00:56:26 +0000 |
| Subject: | Re: array and a class | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113036@lists.php.net to get a copy of this message | ||
solved it thx anyway
"Pafo" <pafo@pafo.net> skrev i meddelandet
news:20020816181910.37226.qmail@pb1.pair.com...
> i got my nice looking class like this:
> <?php
>
> class Relic {
> var $RelicName;
> var $RelicType;
> var $RelicRealm;
> var $RelicOwner;
>
> function PrintInfo() {
> print "$this->RelicName : $this->RelicType : $this->RelicRealm :
> $this->RelicOwner<br>";
> }
>
> function CheckForPrint() {
> if ($this->RelicName == "" || $this->RelicType == "" ||
$this->RelicRealm
> == "" || $this->RelicOwner == "") {
> return false;
> } else {
> return true;
> }
> }
>
> function Clean() {
> $this->RelicName = "";
> $this->RelicType = "";
> $this->RelicRealm = "";
> $this->RelicOwner = "";
> }
>
> function SetName($name) {
> $this->RelicName = $name;
> }
>
> function SetType($type) {
> $this->RelicType = $type;
> }
>
> function SetRealm($realm) {
> $this->RelicRealm = $realm;
> }
>
> function SetOwner($owner) {
> $this->RelicOwner = $owner;
> }
>
> function DebugPrint() {
> print $this->RelicName;
> }
> }
>
> $temp = new Relic();
> $temp->SetName("test");
> $temp->DebugPrint();
> ?>
>
> but the thing is i want an array that is based on my class, so i want to
use
> $relicarray[1]->DebugPrint();
> how does it work,, anyone that can give me a working example, cause i cant
> find any :/
>
> regards
> patrick
>
>