| @@ 1669-1677 (lines=9) @@ | ||
| 1666 | * |
|
| 1667 | * @return string |
|
| 1668 | */ |
|
| 1669 | public function getId($string, $separator = '_') |
|
| 1670 | { |
|
| 1671 | $pos = strrpos($string, $separator); |
|
| 1672 | if ($pos === false) { |
|
| 1673 | return $string; |
|
| 1674 | } else { |
|
| 1675 | return intval(substr($string, $pos + 1)); |
|
| 1676 | } |
|
| 1677 | } |
|
| 1678 | ||
| 1679 | /** |
|
| 1680 | * Fonction "inverse" de getId (depuis xxxx-99 on récupère xxxx) |
|
| @@ 1689-1697 (lines=9) @@ | ||
| 1686 | * |
|
| 1687 | * @return string |
|
| 1688 | */ |
|
| 1689 | public function getName($string, $separator = '_') |
|
| 1690 | { |
|
| 1691 | $pos = strrpos($string, $separator); |
|
| 1692 | if ($pos === false) { |
|
| 1693 | return $string; |
|
| 1694 | } else { |
|
| 1695 | return substr($string, 0, $pos); |
|
| 1696 | } |
|
| 1697 | } |
|
| 1698 | ||
| 1699 | /** |
|
| 1700 | * Renvoie un montant nul si le montant est négatif |
|