getId(); if (!$cust_id){ $new_customer = TRUE; } $this->getResource() ->loadAllAttributes() ->save($this); if ($new_customer){ $new_cust_points = 50; $write = Mage::getSingleton('core/resource')->getConnection('core_write'); // now write the points $cust_id = $this->getId(); $write->insert('points', array('cust_id'=>$cust_id, 'points'=>$new_cust_points)); } return $this; } }