本文整理汇总了PHP中Societe::setValueFrom方法的典型用法代码示例。如果您正苦于以下问题:PHP Societe::setValueFrom方法的具体用法?PHP Societe::setValueFrom怎么用?PHP Societe::setValueFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Societe
的用法示例。
在下文中一共展示了Societe::setValueFrom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runTrigger
/**
* Function called when a Dolibarrr business event is done.
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
*
* @param string $action Event action code
* @param Object $object Object
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
// Mettre ici le code a executer en reaction de l'action
// Les donnees de l'action sont stockees dans $object
if ($action == 'PAYPAL_PAYMENT_OK') {
dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". source=" . $object->source . " ref=" . $object->ref);
if (!empty($object->source)) {
if ($object->source == 'membersubscription') {
//require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherents.class.php';
// TODO add subscription treatment
} else {
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
$soc = new Societe($this->db);
// Parse element/subelement (ex: project_task)
$element = $path = $filename = $object->source;
if (preg_match('/^([^_]+)_([^_]+)/i', $object->source, $regs)) {
$element = $path = $regs[1];
$filename = $regs[2];
}
// For compatibility
if ($element == 'order') {
$path = $filename = 'commande';
}
if ($element == 'invoice') {
$path = 'compta/facture';
$filename = 'facture';
}
dol_include_once('/' . $path . '/class/' . $filename . '.class.php');
$classname = ucfirst($filename);
$obj = new $classname($this->db);
$ret = $obj->fetch('', $object->ref);
if ($ret < 0) {
return -1;
}
// Add payer id
$soc->setValueFrom('ref_int', $object->payerID, 'societe', $obj->socid);
// Add transaction id
$obj->setValueFrom('ref_int', $object->resArray["TRANSACTIONID"]);
}
} else {
// TODO add free tag treatment
}
}
return 0;
}
示例2: GETPOST
// We defined value code_fournisseur
$_POST["code_fournisseur"] = "Acompleter";
}
if ($action == 'set_localtax1') {
//obtidre selected del combobox
$value = GETPOST('lt1');
$object = new Societe($db);
$object->fetch($socid);
$res = $object->setValueFrom('localtax1_value', $value);
}
if ($action == 'set_localtax2') {
//obtidre selected del combobox
$value = GETPOST('lt2');
$object = new Societe($db);
$object->fetch($socid);
$res = $object->setValueFrom('localtax2_value', $value);
}
// Add new or update third party
if (!GETPOST('getcustomercode') && !GETPOST('getsuppliercode') && ($action == 'add' || $action == 'update') && $user->rights->societe->creer) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
if ($action == 'update') {
$ret = $object->fetch($socid);
$object->oldcopy = dol_clone($object);
} else {
$object->canvas = $canvas;
}
if (GETPOST("private") == 1) {
$object->particulier = GETPOST("private");
$object->name = dolGetFirstLastname(GETPOST('firstname', 'alpha'), GETPOST('nom', 'alpha') ? GETPOST('nom', 'alpha') : GETPOST('name', 'alpha'));
$object->civility_id = GETPOST('civility_id', 'int');
// Add non official properties