示例#1
0
 /**
  * @covers Soliant\SimpleFM\Adapter::setCallParams
  */
 public function testSetCallParams()
 {
     $params = array('layoutname' => 'tab', 'commandstring' => 'soliant=consulting');
     $value = $this->object->setCallParams($params);
     $this->assertTrue($value instanceof $this->object);
     $this->assertEquals($this->object->getLayoutname(), 'tab');
     $this->assertEquals($this->object->getCommandstring(), 'soliant=consulting');
 }
示例#2
0
 */
$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'));
/**
 * ...or with the setUsername and setPassword methods.
 */
$adapter->setUsername('Admin');
$adapter->setPassword('');
/**
 * There are individual getters and settes for every property (except there is no getter for the password property)
 * Experiment with the getters and setters to modify the adapter and set new queries for execution
 */
$adapter->setLayoutname('Projects');
/**