Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
6 + 9 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
topicstable = $this->db->prefix("topics"); if (is_array($storyid)) { $this->makeStory($storyid); $this->newstopic = $this->topic(); } elseif($storyid != -1) { $this->getStory(intval($storyid)); $this->newstopic = $this->topic(); } } [/code] On makeStory method in class XoopsStory we aren't get new instances of XoopsStory (...) [code] function makeStory($array) { foreach ( $array as $key=>$value ){ $this->$key = $value; } } [/code] Best regards, Celso Goya moinho.net[/quote]" />

Why we need use is_array on object constructor
by Oki on 2003/10/24 10:56:26

Hi,

I have a big question. I have studied the code of XOOPS Classes, but i can't understand why we need to use the function is_array() if always the variable is replaced by the next array item.

I look in all code for an answer, but i can't find.

Is it a bug trap?

le="color: #000000"><?php class.newsstory.php function NewsStory($storyid=-1) { $this->db =& Database::getInstance(); $this->table = $this->db->prefix("stories"); $this->topicstable = $this->db->prefix("topics"); if (is_array($storyid)) { $this->makeStory($storyid); $this->newstopic = $this->topic(); } elseif($storyid != -1) { $this->getStory(intval($storyid)); $this->newstopic = $this->topic(); } }


On makeStory method in class XoopsStory we aren't get new instances of XoopsStory

(...)

le="color: #000000"><?php function makeStory($array) { foreach ( $array as $key=>$value ){ $this->$key = $value; } }



Best regards,
Celso Goya
moinho.net

Who's Online

123 user(s) are online (79 user(s) are browsing Support Forums)


Members: 0


Guests: 123


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits