From ef5b4e212c563429d027d7b14abbafa40e3c7886 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Mon, 18 Nov 2019 09:59:56 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B02371=20deprecate=20\MetaModel::EnumLinks?= =?UTF-8?q?Classes=20and=20\MetaModel::EnumLinkingClasses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/metamodel.class.php | 15 ++++++++------- test/testlist.inc.php | 6 ++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 1068854cf..4b21582c8 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -7077,7 +7077,7 @@ abstract class MetaModel if ($bSkipLinkingClasses) { - $aLinksClasses = self::EnumLinksClasses(); + $aLinksClasses = array_keys(self::GetLinkClasses()); } // 1-N links (referencing my class), array of sClass => array of sAttcode @@ -7115,12 +7115,12 @@ abstract class MetaModel } /** - * @deprecated It is not recommended to use this function: call {@link MetaModel::GetLinkClasses} instead ! + * @deprecated 2.5.0 It is not recommended to use this function: call {@link MetaModel::GetLinkClasses} instead ! * The only difference with EnumLinkingClasses is the output format * + * @see MetaModel::GetLinkClasses * @return string[] classes having at least two external keys (thus too many classes as compared to GetLinkClasses) * - * @see MetaModel::GetLinkClasses */ public static function EnumLinksClasses() { @@ -7149,15 +7149,16 @@ abstract class MetaModel } /** - * @deprecated It is not recommended to use this function: call {@link MetaModel::GetLinkClasses} instead ! + * @deprecated 2.5.0 It is not recommended to use this function: call {@link MetaModel::GetLinkClasses} instead ! * The only difference with EnumLinksClasses is the output format * - * @param string $sClass + * @see MetaModel::GetLinkClasses + * + *@param string $sClass * * @return string[] classes having at least two external keys (thus too many classes as compared to GetLinkClasses) * @throws \CoreException * - * @see MetaModel::GetLinkClasses */ public static function EnumLinkingClasses($sClass = "") { @@ -7206,7 +7207,7 @@ abstract class MetaModel * actually an N-N relation because it is based on the decision made by the * designer the data model * - * @return array external key code => target class + * @return array (target class => (external key code => target class)) * @throws \CoreException */ public static function GetLinkClasses() diff --git a/test/testlist.inc.php b/test/testlist.inc.php index 8567362dd..62a78b620 100644 --- a/test/testlist.inc.php +++ b/test/testlist.inc.php @@ -285,10 +285,8 @@ class TestMyBizModel extends TestBizModel echo "

Enum links

"; self::DumpVariable(MetaModel::EnumReferencedClasses("cmdbTeam")); self::DumpVariable(MetaModel::EnumReferencingClasses("Organization")); - - self::DumpVariable(MetaModel::EnumLinkingClasses()); - self::DumpVariable(MetaModel::EnumLinkingClasses("cmdbContact")); - self::DumpVariable(MetaModel::EnumLinkingClasses("cmdWorkshop")); + + self::DumpVariable(MetaModel::GetLinkClasses()); self::DumpVariable(MetaModel::GetLinkLabel("Liens_entre_contacts_et_workshop", "toworkshop")); }