thephpleague/csv — pull request #52 by tstuttard (2014-10-03 11:16:07+00:00)
Title: Allow objects to be passed to Writer::insertOne()

Add isValidArray to AbstractCSV. Check if variable is an object and implements toArray()
Add isValidArray($row) check to allow $objects to be converted to an array
Add testInsertObjectWithToArray() to WriterTest

This allows an object to be passed to insertOne($row). When the validateRow($row) is ran it checks if it is an object and that the object implements a toArray() method before excuting that method.

This would be useful if you have a collection of objects. Instead of having to implement a __toString() that converts the object to a CSV string, you implement a toArray() method on the object that returns an array.

This allows for items in the returned array to be check for if they are convertable.