Esempio n. 1
0
 /**
  * Copies all attributes from object into self.
  * 
  * @param XML $from
  * @param bool $overwrite
  * @return XML
  */
 public function copyAttributes($from, $overwrite = false)
 {
     foreach ($from->attributes() as $kk => $vv) {
         if ($overwrite || !isset($this[$kk])) {
             $this[$kk] = (string) $vv;
         }
     }
     return $this;
 }
Esempio n. 2
0
 public static function asXML($tables)
 {
     $out = new XML('<model/>');
     foreach ($tables as $table_name) {
         self::TableAsXML($table_name, $out->addChild('table'));
     }
     return $out;
 }