本文整理汇总了PHP中Adherent::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Adherent::create方法的具体用法?PHP Adherent::create怎么用?PHP Adherent::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adherent
的用法示例。
在下文中一共展示了Adherent::create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
$adh->photo = $_POST["photo"];
$adh->note = $_POST["note"];
$adh->pays_id = $_POST["pays_id"];
$adh->typeid = $_POST["type"];
$adh->note = $_POST["comment"];
$adh->morphy = $_POST["morphy"];
$adh->naiss = $birthday;
foreach($_POST as $key => $value){
if (preg_match("/^options_/",$key)){
$adh->array_options[$key]=$_POST[$key];
}
}
$result=$adh->create($user->id);
if ($result > 0)
{
// Send email to say it has been created and will be validated soon...
if (! empty($conf->global->ADHERENT_AUTOREGISTER_MAIL) && ! empty($conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT))
{
$result=$adh->send_an_email($conf->global->ADHERENT_AUTOREGISTER_MAIL,$conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT,array(),array(),array(),"","",0,-1);
}
if ($backtopage) $urlback=$backtopage;
else if ($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)
{
$urlback=$conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION;
// TODO Make replacement of __AMOUNT__, etc...
}
else $urlback=$_SERVER["PHP_SELF"]."?action=added";
示例2:
$member->public = 1;
$member->birth = dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_BIRTHDATE]);
$member->statut = -1;
if (isset($ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS])) {
$member->datec = dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
$member->datevalid = dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
$member->statut = $ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS];
}
//if ($member->statut > 1) $member->statut=1;
//print_r($ldapuser);
// Propriete type membre
$member->typeid = $typeid;
// Creation membre
print $langs->transnoentities("MemberCreate") . ' # ' . $key . ': login=' . $member->login . ', fullname=' . $member->getFullName($langs);
print ', datec=' . $member->datec;
$member_id = $member->create($user);
if ($member_id > 0) {
print ' --> Created member id=' . $member_id . ' login=' . $member->login;
} else {
$error++;
print ' --> ' . $member->error;
}
print "\n";
//print_r($member);
$datefirst = '';
if ($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE) {
$datefirst = dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
$pricefirst = price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT]);
}
$datelast = '';
if ($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE) {
示例3: testAdherentCreate
/**
*/
public function testAdherentCreate()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$localobject=new Adherent($this->savdb);
$localobject->initAsSpecimen();
$result=$localobject->create($user);
print __METHOD__." result=".$result."\n";
$this->assertLessThan($result, 0);
return $result;
}