Suppose you are working on product object. And for example $_product->getProductUrl() is using the method getProductUrl() to get the url, but you need price or somthing else and have no idea what method calls that

Well there is a way to see all methods of object. And it’s simple as below

$_product = Mage::getModel('catalog/product')->load(877);
$class_name = get_class($_product);
$methods = get_class_methods($class_name);
echo "<pre>";print_r($methods);

And Result is

Array
(
    [0] => getStoreId
    [1] => getResourceCollection
    [2] => getUrlModel
    [3] => validate
    [4] => getName
    [5] => getPrice
    [6] => setPriceCalculation
    [7] => getTypeId
    [8] => getStatus
    [9] => getTypeInstance
    [10] => setTypeInstance
    [11] => getLinkInstance
    [12] => getIdBySku
    [13] => getCategoryId
    [14] => getCategory
    [15] => setCategoryIds
    [16] => getCategoryIds
    [17] => getCategoryCollection
    [18] => getWebsiteIds
    [19] => getStoreIds
    [20] => getAttributes
    [21] => canAffectOptions
    [22] => cleanCache
    [23] => getPriceModel
    [24] => getGroupPrice
    [25] => getTierPrice
    [26] => getTierPriceCount
    [27] => getFormatedTierPrice
    [28] => getFormatedPrice
    [29] => setFinalPrice
    [30] => getFinalPrice
    [31] => getCalculatedFinalPrice
    [32] => getMinimalPrice
    [33] => getSpecialPrice
    [34] => getSpecialFromDate
    [35] => getSpecialToDate
    [36] => getRelatedProducts
    [37] => getRelatedProductIds
    [38] => getRelatedProductCollection
    [39] => getRelatedLinkCollection
    [40] => getUpSellProducts
    [41] => getUpSellProductIds
    [42] => getUpSellProductCollection
    [43] => getUpSellLinkCollection
    [44] => getCrossSellProducts
    [45] => getCrossSellProductIds
    [46] => getCrossSellProductCollection
    [47] => getCrossSellLinkCollection
    [48] => getGroupedLinkCollection
    [49] => getMediaAttributes
    [50] => getMediaGalleryImages
    [51] => addImageToMediaGallery
    [52] => getMediaConfig
    [53] => duplicate
    [54] => isSuperGroup
    [55] => isSuperConfig
    [56] => isGrouped
    [57] => isConfigurable
    [58] => isSuper
    [59] => getVisibleInCatalogStatuses
    [60] => getVisibleStatuses
    [61] => isVisibleInCatalog
    [62] => getVisibleInSiteVisibilities
    [63] => isVisibleInSiteVisibility
    [64] => isDuplicable
    [65] => setIsDuplicable
    [66] => isSalable
    [67] => isAvailable
    [68] => getIsSalable
    [69] => isVirtual
    [70] => isRecurring
    [71] => isSaleable
    [72] => isInStock
    [73] => getAttributeText
    [74] => getCustomDesignDate
    [75] => getProductUrl
    [76] => getUrlInStore
    [77] => formatUrlKey
    [78] => getUrlPath
    [79] => addAttributeUpdate
    [80] => toArray
    [81] => fromArray
    [82] => loadParentProductIds
    [83] => delete
    [84] => getRequestPath
    [85] => getGiftMessageAvailable
    [86] => getRatingSummary
    [87] => isComposite
    [88] => canConfigure
    [89] => getSku
    [90] => getWeight
    [91] => getOptionInstance
    [92] => getProductOptionsCollection
    [93] => addOption
    [94] => getOptionById
    [95] => getOptions
    [96] => getIsVirtual
    [97] => addCustomOption
    [98] => setCustomOptions
    [99] => getCustomOptions
    [100] => getCustomOption
    [101] => hasCustomOptions
    [102] => canBeShowInCategory
    [103] => getAvailableInCategories
    [104] => getDefaultAttributeSetId
    [105] => getImageUrl
    [106] => getSmallImageUrl
    [107] => getThumbnailUrl
    [108] => getReservedAttributes
    [109] => isReservedAttribute
    [110] => setOrigData
    [111] => reset
    [112] => getCacheIdTagsWithCategories
    [113] => cleanModelCache
    [114] => isProductsHasSku
    [115] => processBuyRequest
    [116] => getPreconfiguredValues
    [117] => prepareCustomOptions
    [118] => getProductEntitiesInfo
    [119] => isDisabled
    [120] => afterCommitCallback
    [121] => lockAttribute
    [122] => unlockAttribute
    [123] => unlockAttributes
    [124] => getLockedAttributes
    [125] => hasLockedAttributes
    [126] => isLockedAttribute
    [127] => setData
    [128] => unsetData
    [129] => loadByAttribute
    [130] => getStore
    [131] => getWebsiteStoreIds
    [132] => setAttributeDefaultValue
    [133] => getAttributeDefaultValue
    [134] => setExistsStoreValueFlag
    [135] => getExistsStoreValueFlag
    [136] => isDeleteable
    [137] => setIsDeleteable
    [138] => isReadonly
    [139] => setIsReadonly
    [140] => getIdFieldName
    [141] => getId
    [142] => setId
    [143] => getResourceName
    [144] => getCollection
    [145] => load
    [146] => afterLoad
    [147] => save
    [148] => isObjectNew
    [149] => getCacheTags
    [150] => getCacheIdTags
    [151] => getResource
    [152] => getEntityId
    [153] => clearInstance
    [154] => __construct
    [155] => isDeleted
    [156] => hasDataChanges
    [157] => setIdFieldName
    [158] => addData
    [159] => unsetOldData
    [160] => getData
    [161] => setDataUsingMethod
    [162] => getDataUsingMethod
    [163] => getDataSetDefault
    [164] => hasData
    [165] => __toArray
    [166] => toXml
    [167] => toJson
    [168] => toString
    [169] => __call
    [170] => __get
    [171] => __set
    [172] => isEmpty
    [173] => serialize
    [174] => getOrigData
    [175] => dataHasChangedFor
    [176] => setDataChanges
    [177] => debug
    [178] => offsetSet
    [179] => offsetExists
    [180] => offsetUnset
    [181] => offsetGet
    [182] => isDirty
    [183] => flagDirty
)
credit Matthias Kleine

Be kind to one another. Take care!

Tags:
No Comments

Post A Comment