Code improvement : change fiche function

getAttribut becomes load_attribute,
 strAttribut becomes set_attribute
getAttribut becomes get_attribute
This commit is contained in:
sparkyx 2025-08-01 17:44:22 +02:00
parent 6c3154abbd
commit 007e0c94a2
2 changed files with 34 additions and 2 deletions

View file

@ -195,6 +195,13 @@ class Fiche
$this->load_attribute();
return 0;
}
/**
* @brief replace by set_attribute
* @deprecated since version 9.3.0.12
*/
function setAttribut($p_ad_id,$p_value) {
$this->set_attribute($p_ad_id, $p_value);
}
/**
*@brief set an attribute by a value, if the attribut array is empty
* a call to load_attribute is performed
@ -216,6 +223,14 @@ class Fiche
}
}
}
/**
* @brief replace by load_attribute
* @deprecated since version 9.3.0.12
* @return type
*/
function getAttribut() {
return Card_Property::load($this);
}
/**
*\brief get all the attribute of a card, add missing ones
* and sort the array ($this-\>attribut) by ad_id
@ -298,6 +313,16 @@ class Fiche
"<TR> <TD>".
$this->attribut_def."</TD></TR>";
}
/**
* @brief use get_attribute instead
* @deprecated since version 9.3.0.12
* @param int $p_ad_id AD_ID from attr_def.ad_id
* @param int $p_return 1 return NOTFOUND otherwise an empty string
*/
function strAttribut($p_ad_id,$p_return=1)
{
return get_attribute($p_ad_id,$p_return);
}
/***
* @brief return the string of the given attribute
* (attr_def.ad_id)