Very often (for example when work with dom or UI object) setting plenty of object properties is require. At this time we has not a lot options.
Standard way looks very dirty and be reason of more copy-paste-work.
Reproduce code:
---------------
$myLongNameObject = new MyLongNameObject();
$myLongNameObject->property1 = '11111';
$myLongNameObject->property2 = '22222';
$myLongNameObject->property3 = '33333';
$myLongNameObject->property4 = '44444';
$myLongNameObject->property5 = '55555';
Or worse case:
$myLongNameObject = new MyLongNameObject(); // Proxy pattern
$myLongNameObject->property1 = '11111';
$myLongNameObject->property2 = '22222';
$myLongNameObject->property3 = '33333';
$myLongNameObject->insideObject = new InsideObject();
$myLongNameObject->insideObject->propertyOne = '1111';
$myLongNameObject->insideObject->propertyTwo = '2222';
$myLongNameObject->insideObject->propertyThree = '3334';
$myLongNameObject->insideObject->propertyFour = '4444';
So, apparently, that is not good. We can use special constructor code and array like parameter of constructor like this:
$MyLongNameObject = new MyLongNameObject( array(
'property1' = '1111',
'property2' = '2222',
.....
));
But it's look like crutch and can't extended with IDE. Match better if we can set multiple properties in one time something like this:
$MyLongNameObject = new MyLongNameObject() {