#111: Value wrappers
--------------------------+-------------------------------------------------
Reporter: zYne | Owner: somebody
Type: enhancement | Status: new
Priority: major | Milestone: 2.0.0
Component: Other | Version:
Resolution: | Keywords:
Has_test: 0 | Mystatus: Pending Core Response
Has_patch: 0 |
--------------------------+-------------------------------------------------
Changes (by Zim):
* has_patch: => 0
* mystatus: => Pending Core Response
* has_test: => 0
Old description:
> class Account {
> public function setTableDefinition() {
> $this->hasColumn('amount', 'integer', 20, array('wrapper' =>
> 'Money'));
> }
> }
>
> class Money {
> private $sum;
>
> public function __construct($sum) {
> $this->sum = $sum;
> }
>
> public function getValue() {
> return $this->sum;
> }
>
> public function setValue($sum) {
> $this->sum = $sum;
> }
>
> public function getCurrency() ...
>
> public function setCurrency() ...
>
> }
>
> $a = new Account();
>
> $a->amount; // Money object
New description:
{{{
class Account {
public function setTableDefinition() {
$this->hasColumn('amount', 'integer', 20, array('wrapper' =>
'Money'));
}
}
class Money {
private $sum;
public function __construct($sum) {
$this->sum = $sum;
}
public function getValue() {
return $this->sum;
}
public function setValue($sum) {
$this->sum = $sum;
}
public function getCurrency() ...
public function setCurrency() ...
}
$a = new Account();
$a->amount; // Money object
}}}
--
Ticket URL: <http://trac.doctrine-project.org/ticket/111#comment:3>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---