Aktualna wersja tworzy tablicę identyfikatorów PZ-ów i przekazuje odpowiednio do NaPodstawie (to działa) lub NaPodstawieWielu
Co robię źle?
$sources_arr = array();
if(isset($data->source_ident) && !$doc_id)
{
foreach($data->source_ident as $source_ident)
{
$dok = $this->System_m->get_details('dok__Dokument', NULL, array('dok_NrPelny'=>$source_ident));
if(is_object($dok))
$sources_arr[] = $dok->dok_Id;
else
die('Problem z source_ident - insertDOC _m');
}
if(count($sources_arr)>1)
$wd->NaPodstawieWielu($sources_arr);
else
$wd->NaPodstawie($sources_arr[0]);
}
$wd->Zapisz();