コード例 #1
0
ファイル: AbstractGateway.php プロジェクト: rjakes/SimpleFM
 public function delete(AbstractEntity $entity)
 {
     $commandArray = array('-recid' => $entity->getRecid(), '-modid' => $entity->getModid(), '-delete' => NULL);
     $this->simpleFMAdapter->setCommandArray($commandArray)->setLayoutname($this->getEntityLayout());
     $result = $this->handleAdapterResult($this->simpleFMAdapter->execute());
     return true;
 }
コード例 #2
0
ファイル: AdapterTest.php プロジェクト: rjakes/SimpleFM
 /**
  * @covers Soliant\SimpleFM\Adapter::errorToEnglish
  */
 public function testErrorToEnglish()
 {
     $error = array(0 => 'No Error', 10 => 'Requested data is missing');
     $this->assertEquals($this->object->errorToEnglish(10), 'Requested data is missing');
 }
コード例 #3
0
ファイル: simplefm_example.php プロジェクト: rjakes/SimpleFM
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);
require_once '../library/Soliant/SimpleFM/Adapter.php';
require_once '../library/Soliant/SimpleFM/Loader/FilePostContents.php';
use Soliant\SimpleFM\Adapter;
/**
 * The hostname can either be an IP address or any valid network name you have configured and hosting the
 * FileMaker XML API. FMServer_Sample.fmp12 is included with FileMaker Server 12; the default username is
 * Admin with blank password. You should always leave off the file extension when configuring dbname.
 */
$hostParams = array('hostname' => 'localhost', 'dbname' => 'FMServer_Sample', 'username' => 'Admin', 'password' => '');
/**
 * Initialize the adapter with the hostParams array for your environment.
 */
$adapter = new Adapter($hostParams);
/**
 * At runtime, you can update hostParams on an adapter that has already been instantiated.
 */
$adapter->setHostParams(array('hostname' => 'localhost', 'dbname' => 'FMServer_Sample', 'username' => 'someusername', 'password' => 'somepassword'));
/**
 * After you have initialized a SimpleFMAdapter with valid credentials, there are a number of ways to make calls with it.
 * The simplest is to setCallParams with a layoutname and a commandstring. The commandstring follows the XML RPC
 * syntax for FileMaker Server 12. See /documentation/fms12_cwp_xml_en.pdf, Appendix A on page 43 for details.
 */
$adapter->setCallParams(array('layoutname' => 'Tasks', 'commandstring' => '-max=10&-skip=5&-findall'));
/**
 * You may also update an adapter's credentials at runtime, either by setCredentials with a new array
 */
$adapter->setCredentials(array('username' => 'someotherusername', 'password' => 'someotherpassword'));
/**