Class dao_portfolio

Description

data access object for table portfolio

Located in /lib/dao_portfolio.class.php (line 32)

vo
   |
   --vo_portfolio
      |
      --dao_portfolio
Variable Summary
Method Summary
 void add_position (dao_position $position)
 float get_gain ([bool $adjust_by_charges = false], [bool $as_percentage = false])
 float get_invested ()
 float get_market_value ()
 array get_positions ()
Variables
float $_charges = 0.0 (line 56)

total charges paid on all positions in the portfolio

  • access: private
float $_invested = 0.0 (line 44)

amount of money invested in the portfolio

  • access: private
float $_market_value = 0.0 (line 50)

total market value of all positions in the portfolio

  • access: private
int $_most_recent_quotetime = 0 (line 62)

unix-timestamp of the most recent quote (of a position) in the portfolio

  • access: private
array $_positions = array() (line 38)

cache of postion objects

  • access: private
bool $_quotes_incomplete = false (line 69)

true if not all positions have a current quote, $_market_value

is incorrect in this case

  • access: private

Inherited Variables

Inherited from vo_portfolio

vo_portfolio::$comment
vo_portfolio::$date_created
vo_portfolio::$id
vo_portfolio::$id_user
vo_portfolio::$name
vo_portfolio::$order
vo_portfolio::$taxallowance
vo_portfolio::$type
Methods
add_position (line 77)

add a position to this portfolio

  • access: public
void add_position (dao_position $position)
get_gain (line 118)

return gain

market value minus invested money, optionally deducted by charges and/or as percentage value

  • access: public
float get_gain ([bool $adjust_by_charges = false], [bool $as_percentage = false])
  • bool $adjust_by_charges
  • bool $as_percentage
get_invested (line 106)

return amount of money invested in this portfolio

  • access: public
float get_invested ()
get_market_value (line 138)

return current market value of this portfolio

  • access: public
float get_market_value ()
get_most_recent_quotetime (line 146)

return unix-timestamp of most recent quote

  • access: public
int get_most_recent_quotetime ()
get_positions (line 98)

returns all positions in the portfolio, each position is a

dao_position object

  • access: public
array get_positions ()
get_quotes_incomplete (line 154)

tell whether quotes for all positions are available

  • access: public
bool get_quotes_incomplete ()

Inherited Methods

Inherited From vo_portfolio

 vo_portfolio::get_primary_key()
 vo_portfolio::store()
 vo_portfolio::typeCheck()

Inherited From vo

 vo::__construct()

Documentation generated on Sun, 22 Aug 2010 11:20:15 +0200 by phpDocumentor 1.4.3