<?php
/**
* @package Lettr
* @subpackage REST_Client
* @access private
* @author Digineo GmbH
* @copyright Digineo GmbH, 2010
* @link http://www.digineo.de
* @link mailto:kontakt@digineo.de
*/
abstract class Lettr_Resource {
private $client;
private $path;
protected function __construct($path){
$this->client = new Lettr_Client();
$this->path = $path;
}
public function get($id){
return $this->query('get', $this->path . '/' . $id);
}
public function create($data){
if(!is_array($data)){
throw new Lettr_IllegalArgumentException("Erwarte ein assoziatives Array als Parameter");
}
return $this->query('post', $this->path, $data);
}
public function update($id, $data){
return $this->query('put', $this->path . '/' . $id, $data);
}
public function delete($id){
return $this->query('delete', $this->path . '/' . $id);
}
public function custom($method, $action, $data = null){
return $this->query($method, $this->path . "/$action", $data);
}
public function customId($method, $id, $action, $data = null){
return $this->query($method, $this->path . "/$id/$action", $data);
}
protected function query($method, $path, $data = null){
$res = $this->client->$method($path, $data);
return $res['data'];
}
}
?>
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| .htaccess | 2025-01-28 22:35 | 118 B | 76129f60960:kunden | -xw-x----- | |
| export.php | 2013-11-12 21:09 | 3.66 KB | 76129f60960:kunden | -xw-x----- | |
| lettr.class.php | 2013-11-12 21:09 | 4.72 KB | 76129f60960:kunden | -xw-x----- | |
| lettr_client.class.php | 2013-11-12 21:09 | 8.53 KB | 76129f60960:kunden | -xw-x----- | |
| lettr_delivery.class.php | 2013-11-12 21:09 | 2.52 KB | 76129f60960:kunden | -xw-x----- | |
| lettr_exceptions.class.php | 2013-11-12 21:09 | 1.64 KB | 76129f60960:kunden | -xw-x----- | |
| lettr_init.php | 2013-11-12 21:09 | 712 B | 76129f60960:kunden | -xw-x----- | |
| lettr_recipient.class.php | 2013-11-12 21:09 | 1.16 KB | 76129f60960:kunden | -xw-x----- | |
| lettr_resource.class.php | 2013-11-12 21:09 | 1.44 KB | 76129f60960:kunden | -xw-x----- | |
| lettr_validation.class.php | 2013-11-12 21:09 | 1.5 KB | 76129f60960:kunden | -xw-x----- | |