Ejemplo n.º 1
0
 public function delete()
 {
     $client = new Client($_REQUEST['client_id']);
     $client->delete();
     header('Location: ' . BASE_URL . '/clients');
     exit;
 }
Ejemplo n.º 2
0
 public function testSaveAndLoad()
 {
     $name = 'Test Client';
     $client = new Client();
     $client->setName($name);
     $client->setContactPerson_id($this->testPersonId);
     $client->save();
     $id = $client->getId();
     $api_key = $client->getApi_key();
     $this->assertNotEmpty($id);
     $this->assertNotEmpty($api_key);
     $client = new Client($id);
     $this->assertEquals($api_key, $client->getApi_key());
     $client = Client::loadByApiKey($api_key);
     $this->assertEquals($id, $client->getId());
 }