Пример #1
0
 public function __construct($array = null)
 {
     parent::__construct();
     if ($array != null) {
         foreach ($array as $row => $v) {
             $this->{$row} = $v;
         }
     }
 }
Пример #2
0
 public function __construct($array = null)
 {
     parent::__construct();
     if (is_numeric($array)) {
         $this->id = $array;
     } else {
         if (is_array($array)) {
             foreach ($array as $row => $v) {
                 $this->{$row} = $v;
             }
         }
     }
 }