本文整理汇总了PHP中FileMaker::newAddCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP FileMaker::newAddCommand方法的具体用法?PHP FileMaker::newAddCommand怎么用?PHP FileMaker::newAddCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileMaker
的用法示例。
在下文中一共展示了FileMaker::newAddCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNewAddCommand
/**
* @covers \airmoi\FileMaker\FileMaker::newAddCommand
*/
public function testNewAddCommand()
{
$command = $this->fm->newAddCommand('sample', ['text_field' => 'Test 1']);
if (!$GLOBALS['OFFICIAL_API']) {
$this->assertInstanceOf(Command\Add::class, $command);
} else {
$this->assertInstanceOf(\FileMaker_Command_Add::class, $command);
}
$command->setField('date_field', date('m/d/Y'));
$result = $command->execute();
if (!$GLOBALS['OFFICIAL_API']) {
$this->assertInstanceOf(Object\Result::class, $result);
} else {
$this->assertInstanceOf(\FileMaker_Result::class, $result);
}
$record = $result->getFirstRecord();
if (!$GLOBALS['OFFICIAL_API']) {
$this->assertInstanceOf(Object\Record::class, $record);
} else {
$this->assertInstanceOf(\FileMaker_Record::class, $record);
}
$this->assertEquals('Test 1', $record->getField('text_field'));
return ['recid' => $record->getRecordId(), 'tableCount' => $result->getTableRecordCount()];
}
示例2: FileMaker
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once 'db.php';
require_once 'vendor/FileMaker.php';
$fm_file = 'TestingMaddox';
$fm_host = '54.246.190.236';
$fm_user = 'maddox.web';
$fm_pass = 'Orange624';
$layout_name = 'a.webXML';
$fm = new FileMaker($fm_file, $fm_host, $fm_user, $fm_pass);
//var_dump($fm->getLayout($layout_name)->listFields());
$sql = 'select * from data where status = 0';
$query = mysql_query($sql);
while ($row = mysql_fetch_assoc($query)) {
$cmd = $fm->newAddCommand($layout_name);
$cmd->setField('email', $row['email']);
$cmd->setField('nameTitle', $row['title']);
$cmd->setField('nameFirst', $row['fname']);
$cmd->setField('nameSurname', $row['lname']);
$cmd->setField('sourceID', $row['maddox_id']);
$cmd->setField('fKeyOpener', $row['opener_id']);
$cmd->setField('fKeyCampaign', 431);
$cmd->setField('fKeyMailchimp', $row['web_id']);
$cmd->setField('leadQualityRating', $row['lead_quality']);
// $cmd->setField('userOpener.clients::fullName', $row['opener_name']);
// $cmd->setField('campaignCode', $row['campaign_name']); Field cannot be modified
$cmd->setField('address1', $row['address_1']);
$cmd->setField('address2', $row['address_2']);
$cmd->setField('addressPostcode', $row['address_postcode']);
$cmd->setField('addressTown', $row['address_town']);