public function setassoc(array $items) { if (count($items) == 0) { return array(); } $result = array(); $t = new tposttransform(); $fileitems = array(); foreach ($items as $a) { $t->post = tpost::newpost($a['class']); $t->setassoc($a); $result[] = $t->post->id; $f = $t->post->files; if (count($f)) { $fileitems = array_merge($fileitems, array_diff($f, $fileitems)); } } unset($t); if ($this->syncmeta) { tmetapost::loaditems($result); } if (count($fileitems)) { tfiles::i()->preload($fileitems); } $this->onselect($result); return $result; }