Translations:Developers/Object oriented programming in PHP/Methods/24/en

This also applies to method saveItem, which demands an object of type MShop_Common_Item_Interface. So all implementations of this interface are accepted by the method. But this interface is implemented by all item classes of all domains and as a consequence every item will pass the type hinting test. The reason, that this general interface is chosen as type is, that methods common to all managers must have identical parameter signatures, because the same abstract class is extended and the same interfaces are implemented by all managers to gain control over each manager. To avoid that items of other domains are processed by the method a simple if clause checks, if the passed item is of the right type, MShop_Product_Item_Interface in this case.