le 10/02/2014 à 10:20
ayachi
Bonjour à vous,
Une âme codeuse charitable, pourez m'expliquer comment récuperer la propriété d'un objet pour la passer en argument d'une fonction seulement si la propriété existe? Peut-etre par le biais d'un tableau en argument, non?
Rigoler pas sur mon code c'est mon premier... ;-)
function flyers($date,$hote,$desc,$lieu,$t1,$t2,$qu,$tenu,$besc,$photo,$brief,$bilan,$fichier,$facture,$client,$ref,$support,$numc) {
$node = new stdClass();
$node-> language = LANGUAGE_NONE;
$node-> type = 'topo_op_ration';
$node-> uid = $GLOBALS["user"]-> uid;
node_object_prepare($node);
$node-> field_date_de_l_op_fly[$node->language][0]['value'] = $date;
$node-> field_campagne_mere[$node->language][]['tid'] = $ref;
$node-> field_type_d_op_ration[$node->language][]['tid'] = $support;
$node-> field_client[$node->language][]['tid'] = $client;
$node-> field_quantit_1[$node->language][0]['value'] = $qu;
$node-> field_tenu[$node->language][0]['value'] = $tenu;
$node-> field_besaces[$node->language][0]['value'] = $besc;
$node-> field_bilan_de_campagne[$node->language][0]['value'] = $bilan;
$node-> field_reportage_photo[$node->language][0]['value'] = $photo;
$node-> field_briefing[$node->language][0]['value'] = $brief;
$node-> field_briefing_document[$node->language][0] = $fichier;
$node-> field_n_facture[$node->language][0]['value'] = $facture;
$node-> field_num_ro_de_campagne[$node->language][0]['value'] = $numc;
$node-> field_emplacements_des_op[$node->language][]['tid'] = $lieu;
$node-> field_horaires1[$node->language][0]['value'] = $t1;
$node-> field_horaires1[$node->language][0]['value2'] = $t2;
$node-> field_h[$node->language][0]['value'] = $hote;
$node-> title = ('Diffusion sur Campagne '.$numc);
node_save($node);
}
for ($v=0;$v<$nb_field_col;$v++) {
$arg3 = $desc[$v];
$arg4 = $lieu[$v];
$arg5 = $t1[$v];
$arg6 = $t2[$v];
$arg7 = $qu[$v];
$arg8 = $tenu;
$arg9 = $besc;
$arg10 = $photo;
$arg11 = $brief;
$arg12 = $bilan;
$arg13 = $fichier;
$arg14 = $facture;
$arg15 = $client;
$arg16 = $ref;
$arg17 = $support;
$arg18 = $numc;
foreach($date[$v] as $arg1){
foreach($hote[$v] as $arg2){
flyers($arg1,$arg2,$arg3,$arg4,$arg5,$arg6,$arg7,$arg8,$arg9,$arg10,$arg11,$arg12,$arg13,$arg14,$arg15,$arg16,$arg17,$arg18);
}
}
}
Une âme codeuse charitable, pourez m'expliquer comment récuperer la propriété d'un objet pour la passer en argument d'une fonction seulement si la propriété existe? Peut-etre par le biais d'un tableau en argument, non?
Rigoler pas sur mon code c'est mon premier... ;-)
function flyers($date,$hote,$desc,$lieu,$t1,$t2,$qu,$tenu,$besc,$photo,$brief,$bilan,$fichier,$facture,$client,$ref,$support,$numc) {
$node = new stdClass();
$node-> language = LANGUAGE_NONE;
$node-> type = 'topo_op_ration';
$node-> uid = $GLOBALS["user"]-> uid;
node_object_prepare($node);
$node-> field_date_de_l_op_fly[$node->language][0]['value'] = $date;
$node-> field_campagne_mere[$node->language][]['tid'] = $ref;
$node-> field_type_d_op_ration[$node->language][]['tid'] = $support;
$node-> field_client[$node->language][]['tid'] = $client;
$node-> field_quantit_1[$node->language][0]['value'] = $qu;
$node-> field_tenu[$node->language][0]['value'] = $tenu;
$node-> field_besaces[$node->language][0]['value'] = $besc;
$node-> field_bilan_de_campagne[$node->language][0]['value'] = $bilan;
$node-> field_reportage_photo[$node->language][0]['value'] = $photo;
$node-> field_briefing[$node->language][0]['value'] = $brief;
$node-> field_briefing_document[$node->language][0] = $fichier;
$node-> field_n_facture[$node->language][0]['value'] = $facture;
$node-> field_num_ro_de_campagne[$node->language][0]['value'] = $numc;
$node-> field_emplacements_des_op[$node->language][]['tid'] = $lieu;
$node-> field_horaires1[$node->language][0]['value'] = $t1;
$node-> field_horaires1[$node->language][0]['value2'] = $t2;
$node-> field_h[$node->language][0]['value'] = $hote;
$node-> title = ('Diffusion sur Campagne '.$numc);
node_save($node);
}
for ($v=0;$v<$nb_field_col;$v++) {
$arg3 = $desc[$v];
$arg4 = $lieu[$v];
$arg5 = $t1[$v];
$arg6 = $t2[$v];
$arg7 = $qu[$v];
$arg8 = $tenu;
$arg9 = $besc;
$arg10 = $photo;
$arg11 = $brief;
$arg12 = $bilan;
$arg13 = $fichier;
$arg14 = $facture;
$arg15 = $client;
$arg16 = $ref;
$arg17 = $support;
$arg18 = $numc;
foreach($date[$v] as $arg1){
foreach($hote[$v] as $arg2){
flyers($arg1,$arg2,$arg3,$arg4,$arg5,$arg6,$arg7,$arg8,$arg9,$arg10,$arg11,$arg12,$arg13,$arg14,$arg15,$arg16,$arg17,$arg18);
}
}
}