PHP Source Code

       /**
         * Processes a collection of objects
         * @param array Collection of objects
         * @return array of arrays
         */
        public function collectionToArrays($collection){
            if (!empty($collection)) {
                foreach ($collection as $obj) {
                    $o[] = $obj->toArray();
                }
            }
            return ($o) ? $o : false;
        }

Output of modManagerLog

Array
(
    [id] => 1
    [user] => 1
    [occurred] => 2015-05-01 13:32:49
    [action] => package_install
    [classKey] => transport.modTransportPackage
    [item] => unknown
)
Array
(
    [id] => 2
    [user] => 1
    [occurred] => 2015-05-01 13:32:49
    [action] => package_install
    [classKey] => transport.modTransportPackage
    [item] => unknown
)
Array
(
    [id] => 3
    [user] => 1
    [occurred] => 2015-05-01 13:32:49
    [action] => package_install
    [classKey] => transport.modTransportPackage
    [item] => unknown
)
Array
(
    [id] => 4
    [user] => 1
    [occurred] => 2015-05-01 13:33:46
    [action] => template_update
    [classKey] => modTemplate
    [item] => 1
)
Array
(
    [id] => 5
    [user] => 1
    [occurred] => 2015-05-01 13:35:01
    [action] => chunk_create
    [classKey] => modChunk
    [item] => 2
)
Array
(
    [id] => 6
    [user] => 1
    [occurred] => 2015-05-01 13:35:43
    [action] => chunk_create
    [classKey] => modChunk
    [item] => 3
)
Array
(
    [id] => 7
    [user] => 1
    [occurred] => 2015-05-01 13:36:37
    [action] => chunk_create
    [classKey] => modChunk
    [item] => 4
)
Array
(
    [id] => 8
    [user] => 1
    [occurred] => 2015-05-01 13:37:13
    [action] => chunk_update
    [classKey] => modChunk
    [item] => 4
)
Array
(
    [id] => 9
    [user] => 1
    [occurred] => 2015-05-01 13:37:24
    [action] => chunk_update
    [classKey] => modChunk
    [item] => 4
)
Array
(
    [id] => 10
    [user] => 1
    [occurred] => 2015-05-01 13:38:02
    [action] => chunk_create
    [classKey] => modChunk
    [item] => 5
)
Array
(
    [id] => 11
    [user] => 1
    [occurred] => 2015-05-01 13:39:04
    [action] => chunk_create
    [classKey] => modChunk
    [item] => 6
)
Array
(
    [id] => 12
    [user] => 1
    [occurred] => 2015-05-01 13:44:40
    [action] => chunk_update
    [classKey] => modChunk
    [item] => 6
)
Array
(
    [id] => 13
    [user] => 1
    [occurred] => 2015-05-01 13:45:18
    [action] => chunk_create
    [classKey] => modChunk
    [item] => 7
)
Array
(
    [id] => 14
    [user] => 1
    [occurred] => 2015-05-01 13:45:24
    [action] => chunk_update
    [classKey] => modChunk
    [item] => 7
)
Array
(
    [id] => 15
    [user] => 1
    [occurred] => 2015-05-01 14:16:33
    [action] => chunk_update
    [classKey] => modChunk
    [item] => 6
)
Array
(
    [id] => 16
    [user] => 1
    [occurred] => 2015-05-01 14:18:06
    [action] => template_update
    [classKey] => modTemplate
    [item] => 1
)
Array
(
    [id] => 17
    [user] => 1
    [occurred] => 2015-05-01 14:19:27
    [action] => chunk_update
    [classKey] => modChunk
    [item] => 4
)
Array
(
    [id] => 18
    [user] => 1
    [occurred] => 2015-05-01 14:20:57
    [action] => template_update
    [classKey] => modTemplate
    [item] => 1
)
Array
(
    [id] => 19
    [user] => 1
    [occurred] => 2015-05-01 14:21:17
    [action] => template_update
    [classKey] => modTemplate
    [item] => 1
)

In this article