1
Oki
Why we need use is_array on object constructor
  • 2003/10/24 10:56

  • Oki

  • Just popping in

  • Posts: 25

  • Since: 2002/12/4


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

108 user(s) are online (78 user(s) are browsing Support Forums)


Members: 1


Guests: 107


heyula

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