for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Luracast\Restler\RestException;
dol_include_once('/flightlog/class/bbcvols.class.php');
/**
* @author Laurent De Coninck <[email protected]>
*
* @smart-auto-routing false
* @access protected
* @class DolibarrApiAccess {@requires user,external}
*/
class Flightlog extends DolibarrApi
{
* @var array $FIELDS Mandatory fields, checked when create and update object
static $FIELDS = array(
'id'
);
public $flight;
public function __construct()
global $db, $conf;
$this->db = $db;
$this->flight = new Bbcvols($this->db);
}
* Get properties of a commercial proposal object
* Return an array with commercial proposal informations
* @param int $id ID of commercial proposal
* @return array|mixed data without useless information
* @throws RestException
public function get($id)
if(! DolibarrApiAccess::$user->rights->propal->lire) {
throw new RestException(401);
$result = $this->flight->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Flight not found');
if( ! DolibarrApi::_checkAccessToResource('flight',$this->flight->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
return $this->_cleanObjectDatas($this->flight);