All pastes #757214 Raw Edit

flawed

public php v1 · immutable
·published 2007-11-01 02:05 UTC
rendered paste body
<?php/** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * @category   Mage * @package    Mage_Customer * @copyright  Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com) * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0) *//** * Customer * * @category   Mage * @package    Mage_Customer */class Mage_Points_Model_Customer extends Mage_Customer_Model_Customer{    /**     * Save customer     *     * @return Mage_Customer_Model_Customer     */    public function save()    {	$write = Mage::getSingleton('core/resource')->getConnection('core_write');	// retrieve points	$cust_id = $this->getId();	$new_cust_points = 50;	if (!$cust_id){		$this->getResource()            	->loadAllAttributes()            	->save($this);            	// now write the points            	$cust_id = $this->getId();		$write->insert('points', array('cust_id'=>$cust_id, 'points'=>$new_cust_points));	}        return $this;    }}