mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-12 19:02:35 +01:00
Dev phpstan (#26723)
* fix: remove phpstan warning * fix phpstan * fix phpstan * fix phpstan
This commit is contained in:
@@ -726,6 +726,31 @@ abstract class CommonObject
|
||||
*/
|
||||
protected $childtablesoncascade = array();
|
||||
|
||||
/**
|
||||
* @var Product Populate by fetch_product()
|
||||
*/
|
||||
public $product;
|
||||
|
||||
/**
|
||||
* @var int Populate by setPaymentTerms()
|
||||
*/
|
||||
public $cond_reglement_supplier_id;
|
||||
|
||||
/**
|
||||
* @var string Populate by setPaymentTerms()
|
||||
*/
|
||||
public $deposit_percent;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Populate by setRetainedWarrantyPaymentTerms()
|
||||
*/
|
||||
public $retained_warranty_fk_cond_reglement;
|
||||
|
||||
/**
|
||||
* @var int Populate by setWarehouse()
|
||||
*/
|
||||
public $warehouse_id;
|
||||
|
||||
// No constructor as it is an abstract class
|
||||
|
||||
@@ -1943,7 +1968,14 @@ abstract class CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
// Test for avoid error -1
|
||||
if ($obj) {
|
||||
$result = $this->fetch($obj->rowid);
|
||||
if (method_exists($this, 'fetch')) {
|
||||
return $this->fetch($obj->rowid);
|
||||
} else {
|
||||
$this->error = 'fetch() method not implemented on '.get_class($this);
|
||||
dol_syslog(get_class($this).'::fetchOneLike Error='.$this->error, LOG_ERR);
|
||||
array_push($this->errors, $this->error);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user