本文整理汇总了PHP中Adherent::initAsSpecimen方法的典型用法代码示例。如果您正苦于以下问题:PHP Adherent::initAsSpecimen方法的具体用法?PHP Adherent::initAsSpecimen怎么用?PHP Adherent::initAsSpecimen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adherent
的用法示例。
在下文中一共展示了Adherent::initAsSpecimen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Adherent
/*
* Test de la connexion
*/
if (!empty($conf->global->LDAP_MEMBER_ACTIVE)) {
$butlabel = $langs->trans("LDAPTestSynchroMember");
$testlabel = 'testmember';
$key = $conf->global->LDAP_KEY_MEMBERS;
$dn = $conf->global->LDAP_MEMBER_DN;
$objectclass = $conf->global->LDAP_MEMBER_OBJECT_CLASS;
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
}
if (function_exists("ldap_connect")) {
if ($_GET["action"] == 'testmember') {
// Creation objet
$object = new Adherent($db);
$object->initAsSpecimen();
// Test synchro
$ldap = new Ldap();
$result = $ldap->connect_bind();
if ($result > 0) {
$info = $object->_load_ldap_info();
$dn = $object->_load_ldap_dn($info);
$result1 = $ldap->delete($dn);
// To be sure to delete existing records
$result2 = $ldap->add($dn, $info, $user);
// Now the test
$result3 = $ldap->delete($dn);
// Clean what we did
if ($result2 > 0) {
print img_picto('', 'info') . ' ';
print '<font class="ok">' . $langs->trans("LDAPSynchroOK") . '</font><br>';
示例2: 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;
}