views:

63

answers:

1

From this page:

http://www.doctrine-project.org/documentation/manual/1_2/en/working-with-models#dealing-with-relations:creating-related-records

You can see that it says $obj['property']; is the recommended way of referring to an object's property in Doctrine for array portability purposes.

I never heard about this term before and google did not come up with useful result.

What is that?

+2  A: 

the examples shows that

$user->Phonenumbers[]->phonenumber = '123 123';
$user->Phonenumbers[]->phonenumber = '456 123';
$user->Phonenumbers[]->phonenumber = '123 777';

will return Phonenumbers[0] = '123 123', Phonenumbers[1] = '456 123' and Phonenumbers[2] = '123 777'

array portability means that you can add more $obj['property']; for next statement. for example if you add more

$user->Phonenumbers[]->phonenumber = 'xxx xxx';

that will be another Phonenumbers[3] = 'xxx xxx' where array index will increase +1.

apis17