本文整理汇总了PHP中Codes::getPrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP Codes::getPrefix方法的具体用法?PHP Codes::getPrefix怎么用?PHP Codes::getPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Codes
的用法示例。
在下文中一共展示了Codes::getPrefix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPrefixNone
public function testPrefixNone()
{
// test to ensure that the object from an fsockopen is valid
$C = new Codes();
$format = "******";
$prefix = $C->getPrefix($format);
$this->assertTrue(strlen($C->prefix) == 0);
}
示例2: Codes
$mySforceConnection->login(USERNAME, PASSWORD . SECURITY_TOKEN);
/************************** SELECT CDA_id **************************/
/* */
echo "<pre>";
$query = "SELECT Id FROM ContractDealAttribute__c LIMIT 1";
$response = $mySforceConnection->query($query);
//echo "Results of query '$query'<br/><br/>\n";
foreach ($response->records as $record) {
// echo $record->Id ." - " ."<br/>\n";
$cda = $record->Id;
}
/************************** GENERATE SOME CODES **************************/
require_once './codes.php';
$C = new Codes();
$C->format = $_GET['format'];
$C->prefix = $C->getPrefix($C->format);
$C->__construct();
$C->num_random_chars = strlen($C->format) - strlen($C->prefix);
$C->fieldlength = 100;
// sets fieldlength artifically low just for test usually 32768
$codes = $C->generateMany($number_of_codes);
$prep = $C->prepareCodesForInsert($codes);
print_r($codes);
/************************** INSERT DATA INTO SF **************************/
$records = array();
$i = 0;
foreach ($prep as $code) {
$records[$i] = new stdclass();
$records[$i]->Contract_Deal_Attribute__c = $cda;
$records[$i]->Voucher_Code__c = $code;
$i++;