Advertisement
terorama

slider / objstat.inc.php

Aug 21st, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.  
  3. class ObjStat  {
  4.    
  5.    private $objs=array();
  6.    
  7.    public function push($obj) {
  8.       $this->objs[]=$obj;
  9.    }
  10.    //--------------------------------------------------
  11.    public function objlist() {
  12.    
  13.       $rez=count($this->objs).'<br>';
  14.       for ($i=0;$i<count($this->objs);$i++) {
  15.          if ($this->objs[$i] instanceOf AutoInfo) {
  16.             $rez.=$this->objs[$i]->myname.'<br>';
  17.          }
  18.       }
  19.       return ($rez);
  20.    }
  21.    //--------------------------------------------------
  22.    public function show_errors() {
  23.    
  24.       $rez='';
  25.      
  26.       for ($i=0; $i<count($this->objs); $i++) {
  27.          if ($this->objs[$i] instanceOf AutoInfo)
  28.             if ($this->objs[$i]->is_error())
  29.                $rez.=$this->objs[$i]->get_error().'<br>';
  30.       }
  31.      
  32.       return $rez;
  33.    }
  34. }
  35.  
  36.  
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement