concrete/src/Gathering/Gathering.php
public function generateGatheringItems()
    {
        $configuredDataSources = $this->getConfiguredGatheringDataSources();
        $items = array();
        foreach ($configuredDataSources as $configuration) {
            $dataSource = $configuration->getGatheringDataSourceObject();
            $dataSourceItems = $dataSource->createGatheringItems($configuration);
            $items = array_merge($dataSourceItems, $items);
        }

        // now we loop all the items returned, and assign the batch to those items.
        $agiBatchTimestamp = time();
        $db = Loader::db();
        foreach ($items as $it) {
            $it->setGatheringItemBatchTimestamp($agiBatchTimestamp);
            $it->setAutomaticGatheringItemSlotWidth();
            $it->setAutomaticGatheringItemSlotHeight();
        }

        // now, we find all the items with that timestamp, and we update their display order.
        $agiBatchDisplayOrder = 0;
        $r = $db->Execute('select gaiID from GatheringItems where gaID = ? and gaiBatchTimestamp = ? order by gaiPublicDateTime desc', array($this->getGatheringID(), $agiBatchTimestamp));
        while ($row = $r->FetchRow()) {
            $db->Execute('update GatheringItems set gaiBatchDisplayOrder = ? where gaiID = ?', array($agiBatchDisplayOrder, $row['gaiID']));
            ++$agiBatchDisplayOrder;
        }

        $date = Loader::helper('date')->getOverridableNow();
        $db->Execute('update Gatherings set gaDateLastUpdated = ? where gaID = ?', array($date, $this->gaID));
    }
public function generateGatheringItems()
    {
        $configuredDataSources = $this->getConfiguredGatheringDataSources();
        $items = array();
        foreach ($configuredDataSources as $configuration) {
            $dataSource = $configuration->getGatheringDataSourceObject();
            $dataSourceItems = $dataSource->createGatheringItems($configuration);
            $items = array_merge($dataSourceItems, $items);
        }

        // now we loop all the items returned, and assign the batch to those items.
        $agiBatchTimestamp = time();
        $db = Loader::db();
        foreach ($items as $it) {
            $it->setGatheringItemBatchTimestamp($agiBatchTimestamp);
            $it->setAutomaticGatheringItemSlotWidth();
            $it->setAutomaticGatheringItemSlotHeight();
        }

        // now, we find all the items with that timestamp, and we update their display order.
        $agiBatchDisplayOrder = 0;
        $r = $db->Execute('select gaiID from GatheringItems where gaID = ? and gaiBatchTimestamp = ? order by gaiPublicDateTime desc', array($this->getGatheringID(), $agiBatchTimestamp));
        while ($row = $r->FetchRow()) {
            $db->Execute('update GatheringItems set gaiBatchDisplayOrder = ? where gaiID = ?', array($agiBatchDisplayOrder, $row['gaiID']));
            ++$agiBatchDisplayOrder;
        }

        $date = Loader::helper('date')->getOverridableNow();
        $db->Execute('update Gatherings set gaDateLastUpdated = ? where gaID = ?', array($date, $this->gaID));
    }
public function generateGatheringItems ( ) { $ configuredDataSources = $ this -> getConfiguredGatheringDataSources ( ) ; $ items = array ( ) ; foreach ( $ configuredDataSources as $ configuration ) { $ dataSource = $ configuration -> getGatheringDataSourceObject ( ) ; $ dataSourceItems = $ dataSource -> createGatheringItems ( $ configuration ) ; $ items = array_merge ( $ dataSourceItems , $ items ) ; } // now we loop all the items returned, and assign the batch to those items. $ agiBatchTimestamp = time ( ) ; $ db = Loader :: db ( ) ; foreach ( $ items as $ it ) { $ it -> setGatheringItemBatchTimestamp ( $ agiBatchTimestamp ) ; $ it -> setAutomaticGatheringItemSlotWidth ( ) ; $ it -> setAutomaticGatheringItemSlotHeight ( ) ; } // now, we find all the items with that timestamp, and we update their display order. $ agiBatchDisplayOrder = 0 ; $ r = $ db -> Execute ( 'select gaiID from GatheringItems where gaID = ? and gaiBatchTimestamp = ? order by gaiPublicDateTime desc' , array ( $ this -> getGatheringID ( ) , $ agiBatchTimestamp ) ) ; while ( $ row = $ r -> FetchRow ( ) ) { $ db -> Execute ( 'update GatheringItems set gaiBatchDisplayOrder = ? where gaiID = ?' , array ( $ agiBatchDisplayOrder , $ row [ 'gaiID' ] ) ) ; ++ $ agiBatchDisplayOrder ; } $ date = Loader :: helper ( 'date' ) -> getOverridableNow ( ) ; $ db -> Execute ( 'update Gatherings set gaDateLastUpdated = ? where gaID = ?' , array ( $ date , $ this -> gaID ) ) ; }
Runs through all active gathering data sources, creates GatheringItem objects.
Runs through all active gathering data sources creates GatheringItem objects .