G
G
gog692016-08-24 12:25:11
symfony
gog69, 2016-08-24 12:25:11

How to store arrays of objects in a property of another object?

for example, there is a
class Path
{
$name
$href
}
and there is a
class Product
{
private $someProperty
private $someProperty2
}
where someProperty is an array of Path classes
and someProperty2 is also an array, but
it seems to me that it’s not very
possible to use an array for other classes then a smarter collection class that can be used for such cases?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2016-08-24
@gog69

to use array somehow seems to me not very good
That is the class ( ArrayIterator ), but why is it here? To seem smarter?
The usual array is enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question