/** * Returns the first ID of an item in any of the Management API * collections. This was added to make the traversal code easier * to read. * @param collection $collection Any Management API collection. * @return string The ID of the first item in a collection. */ private function getFirstId(&$collection) { $items = $collection->getItems(); return $items[0]->getId(); }