PhalconRest\Mvc\Controllers\CrudResourceController::remove PHP Method

remove() public method

* REMOVE **
public remove ( $id )
    public function remove($id)
    {
        $this->beforeHandle();
        $this->beforeHandleWrite();
        $this->beforeHandleRemove($id);
        $item = $this->getItem($id);
        if (!$item) {
            return $this->onItemNotFound($id);
        }
        if (!$this->removeAllowed($item)) {
            return $this->onNotAllowed();
        }
        $success = $this->removeItem($item);
        if (!$success) {
            return $this->onRemoveFailed($item);
        }
        $response = $this->getRemoveResponse($item);
        $this->afterHandleRemove($item, $response);
        $this->afterHandleWrite();
        $this->afterHandle();
        return $response;
    }