public function toArray($keyColumn = null, $usePrefix = false, $keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = [])
    {
        $ret = [];
        $keyGetterMethod = 'get' . $keyColumn;

        /** @var $obj ActiveRecordInterface */
        foreach ($this as $key => $obj) {
            $key = null === $keyColumn ? $key : $obj->$keyGetterMethod();
            $key = $usePrefix ? ($this->getModel() . '_' . $key) : $key;
            $ret[$key] = $obj->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
        }

        return $ret;
    }
public function toArray($keyColumn = null, $usePrefix = false, $keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = [])
    {
        $ret = [];
        $keyGetterMethod = 'get' . $keyColumn;

        /** @var $obj ActiveRecordInterface */
        foreach ($this as $key => $obj) {
            $key = null === $keyColumn ? $key : $obj->$keyGetterMethod();
            $key = $usePrefix ? ($this->getModel() . '_' . $key) : $key;
            $ret[$key] = $obj->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
        }

        return $ret;
    }
public function toArray ( $ keyColumn = null , $ usePrefix = false , $ keyType = TableMap :: TYPE_PHPNAME , $ includeLazyLoadColumns = true , $ alreadyDumpedObjects = [ ] ) { $ ret = [ ] ; $ keyGetterMethod = 'get' . $ keyColumn ; /** @var $obj ActiveRecordInterface */ foreach ( $ this as $ key => $ obj ) { $ key = null === $ keyColumn ? $ key : $ obj -> $ keyGetterMethod ( ) ; $ key = $ usePrefix ? ( $ this -> getModel ( ) . '_' . $ key ) : $ key ; $ ret [ $ key ] = $ obj -> toArray ( $ keyType , $ includeLazyLoadColumns , $ alreadyDumpedObjects , true ) ; } return $ ret ; }
Get an array representation of the collection
Each object is turned into an array and the result is returned

@param string  $keyColumn              If null, the returned array uses an incremental index.
Otherwise, the array is indexed using the specified column
@param boolean $usePrefix              If true, the returned array prefixes keys
with the model class name ('Article_0', 'Article_1', etc).
@param string  $keyType                (optional) One of the class type constants TableMap::TYPE_PHPNAME,
TableMap::TYPE_CAMELNAME, TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME,
TableMap::TYPE_NUM. Defaults to TableMap::TYPE_PHPNAME.
@param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
@param array   $alreadyDumpedObjects   List of objects to skip to avoid recursion

<code>
$bookCollection->toArray();
array(
0 => array('Id' => 123, 'Title' => 'War And Peace'),
1 => array('Id' => 456, 'Title' => 'Don Juan'),
)
$bookCollection->toArray('Id');
array(
123 => array('Id' => 123, 'Title' => 'War And Peace'),
456 => array('Id' => 456, 'Title' => 'Don Juan'),
)
$bookCollection->toArray(null, true);
array(
'Book_0' => array('Id' => 123, 'Title' => 'War And Peace'),
'Book_1' => array('Id' => 456, 'Title' => 'Don Juan'),
)
</code>

@return array
Get an array representation of the collection Each object is turned into an array and the result is returned