Magento: the best way to avoid extension conflicts

What are the best ways to create a Magento extension to avoid conflicts with other extensions that are uploaded to the repository. I know how to code an override method, observer methods, and details on how to do this. This still does not stop you from having conflicts with other modules and updates.

Alan Storm, if you read this, I also read your recent post on overriding and updating. Is this the best way to think about this type of situation? I also see extensions and articles created by people that allow multiple classes to extend the same class.

+3
source share
1 answer

- Observer, Magento, . , , .

. , , , ( , ). .

, conflicfts , , . , , Magento, , , , .

, , , , , , , , . , :

function doSomethingUseful() {
    // ...100 lines of parent code...
    unset($result['badKey']);
    // ...100 lines of parent code...

    return $result;
}

, 200 . ! - ( ):

function doSomethingUseful() {
    $result = parent::doSomethingUseful();
    unset($result['badKey']);
    return $result;
}

, , , !

, !

,

+11

Source: https://habr.com/ru/post/1765168/


All Articles