コード例 #1
0
ファイル: EdgeModel.php プロジェクト: raulsi/CakePHP-ArangoDb
 /**
  *  Delete Edge
  *
  *  Request to Get edge from the collection
  *
  * @param string/Edge  $doc - Collection ID to delete from / Edge Object to delete.
  * @param string  $id - specify the edge ID to delete the edge.
  * @param array  $param - Array of parameters to send to the database as a header for edge request.
  *
  * @return array/Edge $response/$doc - Return a response array of the request/Edge object.
  */
 public function deleteEdge($doc, $id = NULL, $param = NULL)
 {
     $option = array();
     if (isset($param['waitForSync'])) {
         $option['waitForSync'] = $param['waitForSync'];
     }
     if (isset($param['rev'])) {
         $option['rev'] = $param['rev'];
     }
     if (isset($param['policy'])) {
         $option['policy'] = $param['policy'];
     }
     $header = array();
     if (isset($param['ifmatch'])) {
         $header['If-Match'] = $param['ifmatch'];
     }
     if ($doc instanceof Edge) {
         $collection = $doc->getCollectionID();
         $id = $doc->getId();
     } else {
         $collection = $doc;
     }
     $response = $this->delete('edge/' . $collection . '/' . $id, NULL, 'json', $option, $header);
     return $response;
 }
コード例 #2
0
 /**
  *  Delete Edge
  *
  *  Request to Get edge from the collection
  *
  * @param string/Edge  $index - Collection ID to delete from / Edge Object to delete.
  * @param string  $id - specify the index ID to delete the Index.
  * @param array  $param - Array of parameters to send to the database as a header for edge request.
  *
  * @return array/Edge $response/$doc - Return a response array of the request/Edge object.
  */
 public function deleteIndex($index, $id = NULL, $param = NULL)
 {
     if ($doc instanceof Index) {
         $collection = $index->getCollectionID();
         $id = $index->getId();
     } else {
         $collection = $index;
     }
     $response = $this->delete('index/' . $collection . '/' . $id, NULL, 'json');
     return $response;
 }