public function _saveTransaction($type, $amount, $desc, $cat, $ref)
	{
		$transaction = Transaction::blank()->set(array(
			'uid'         => $this->uid,
			'type'        => $type,
			'amount'      => $amount,
			'description' => $desc,
			'category'    => $cat,
			'referenceid' => $ref,
			'balance'     => $this->balance
		));

		if (!$transaction->save())
		{
			$this->setError($transaction->getError());

			return false;
		}

		return true;
	}
public function _saveTransaction($type, $amount, $desc, $cat, $ref)
	{
		$transaction = Transaction::blank()->set(array(
			'uid'         => $this->uid,
			'type'        => $type,
			'amount'      => $amount,
			'description' => $desc,
			'category'    => $cat,
			'referenceid' => $ref,
			'balance'     => $this->balance
		));

		if (!$transaction->save())
		{
			$this->setError($transaction->getError());

			return false;
		}

		return true;
	}
public function _saveTransaction ( $ type , $ amount , $ desc , $ cat , $ ref ) { $ transaction = Transaction :: blank ( ) -> set ( array ( 'uid' => $ this -> uid , 'type' => $ type , 'amount' => $ amount , 'description' => $ desc , 'category' => $ cat , 'referenceid' => $ ref , 'balance' => $ this -> balance ) ) ; if ( ! $ transaction -> save ( ) ) { $ this -> setError ( $ transaction -> getError ( ) ) ; return false ; } return true ; }
Record the transaction

@param   string   $type    Record type (inserting or updating)
@param   integer  $amount  Amount to process
@param   string   $desc    Transaction description
@param   string   $cat     Transaction category
@param   integer  $ref     ID of item transaction references
@return  boolean  True on success
Record the transaction