$product = Mage::getModel('catalog/product')->load($productId); $productId = $product->getEntityId();
$customer = Mage::getModel('customer/customer')->load($customerId); $customerId = $customer->getEntityId();In this example, we load a customer object via its ID, and then use the getEntityId method to retrieve its entity ID (i.e., customer ID). Both of these examples utilize the getEntityId method provided by the Varien_Object class, which is a part of the Magento core library.