Purge any items in the to create queue that have been inactive for 20
minutes or more.

@param array $data
426319
private function purgeOrphanedToCreateItems(array &$data)
    {
        foreach ($data['toCreate'] as $key => $timestamp) {
            $time = $this->time();

            if ($timestamp + self::DURATION_TWENTY_MINUTES < $this->time()) {
                unset($data['toCreate'][$key]);
            }
        }
    }
1228745
protected function processData($data)
  {
    // set the next_request_timestamp $data->next seconds in the future
    $this->next_request_timestamp=time()+$data->next;
    // check if we have to purge all data
    if($data->reset){
      // purge all data
      $this->debugLog('processData: purging all data');
      // delete all stored prefixes
      // all lists must have no state
      foreach($this->lists as $list => $state){
        $this->lists[$list]='';
        $this->storage->removeHashPrefixesFromList($list);
      }
      $this->storage->updateLists($this->lists);
      // todo: purge cached full hashes
      return;
    }
    foreach($data->listdata as $listdata){
      // for each list
      
      // check if we have to purge all list data
      if($listdata->reset){
        // purge all data
        $this->debugLog('processData: purging data of list '.$listdata->list_name);
        // delete all stored prefixes
        // all list must have no state
        $this->lists[$listdata->list_name]='';
        $this->storage->removeHashPrefixesFromList($listdata->list_name);
      }
      
      $this->lists[$listdata->list_name]=$listdata->newClientState;
      
      // update the lists in the local database (applying the removals before the additions) 
      // https://developers.google.com/safe-browsing/v4/local-databases#database-updates
      
      // fetch removal ThreatEntrySet's
      foreach($listdata->removals as $entry){
        if(isset($entry->rawHashes) && count($entry->rawHashes)>0){ 
          // remove by hash
          $this->storage->removeHashPrefixes($entry->rawHashes,$listdata->list_name);
        }elseif(isset($entry->rawIndices) && count($entry->rawIndices)>0){
          // remove by indice
          $hashes=$this->storage->getHashPrefixesByIndices($entry->rawIndices,$listdata->list_name);
          $this->storage->removeHashPrefixes($hashes,$listdata->list_name);
        }else{
          // nothing??
          $this->debugLog('processData: removal ThreatEntrySet without data!');
        }
      }
      
      // fetch addition ThreatEntrySet's
      foreach($listdata->additions as $entry){
        if(isset($entry->rawHashes) && count($entry->rawHashes)>0){ 
          // remove by hash
          $this->storage->addHashPrefixes($entry->rawHashes,$listdata->list_name);
        }else{
          // nothing??
          $this->debugLog('processData: removal ThreatEntrySet without data!');
        }
      }
      
      if(isset($listdata->checksum)){
        if(isset($listdata->checksum['sha256'])){
          $this->debugLog('processData: checksum for list '.$listdata->list_name.' should be '.$listdata->checksum['sha256']);
          $data_checksum=$this->storage->getListChecksum($listdata->list_name,'sha256');
          if($listdata->checksum['sha256'] != $data_checksum){
            $this->debugLog('processData: checksum for list '.$listdata->list_name.' does not match expected checksum '.$listdata->checksum['sha256'].' != '.$data_checksum);
            // checksum mismatch, so reset the list (next time get the full one)
            $this->lists[$listdata->list_name]='';
            $this->debugLog('processData: Reset list state for '.$listdata->list_name);
          }
        }
      }
      
      // check if we need to bail out
      if($this->pcntl_enabled){
        // process signals with handlers if we received any
        $this->pcntlSignalDispatch();
        if($this->exit_signal_received){
          // signal received, stop processing
          break;
        }
      }
    }// end list loop
    $this->storage->updateLists($this->lists);
  }
314826
protected function cleanup($queue)
    {
        $sql = implode(" ", [
            sprintf(
                'SELECT id FROM %s',
                $this->quoteIdentifier($this->config('table'))
            ),
            sprintf('WHERE %s = ?', $this->quoteIdentifier('queue')),
            'AND expires_at < ?'
        ]);

        $datetime = new DateTime;
        $dtFormatted = $datetime->format('Y-m-d H:i:s');

        try {
            $sth = $this->connection()->prepare($sql);
            $sth->bindParam(1, $queue, PDO::PARAM_STR);
            $sth->bindParam(2, $dtFormatted, PDO::PARAM_STR);

            $sth->execute();
            $result = $sth->fetch(PDO::FETCH_ASSOC);

            if (!empty($result)) {
                $this->reject([
                    'id' => $result['id'],
                    'queue' => $queue
                ]);
            }
        } catch (PDOException $e) {
            $this->logger()->error($e->getMessage());
        }
    }
894938
public function deleteBulk(array $data, array $options = [])
    {
        $this->om->startFlushSuite();

        foreach ($data as $el) {
            //get the element
            $this->delete($el, $options);
        }

        $this->om->endFlushSuite();
    }
975608
public function fill(array $data)
    {
        $this->attributes = array_merge($this->attributes, $this->filterFillable($data));
    }
818696
protected function postUnserialize(array $data)
    {
        $this->repoPath = array_pop($data);
        $this->path = array_pop($data);
    }
1280743
protected function filterData(\ArrayAccess $data): void
    {
        if ($data instanceof Data) {
            $data->filter(true, true);
        }
    }
194920
public function delete(array $data)
  {
    foreach ($data as $key => $id)
    {
      $CostCenter = $this->byId($id);
      $CostCenter->delete();
    }
    // $this->CostCenter->destroy($data);

    return true;
  }
1335967
public function purge()
    {
        $this->dbHandler->beginTransaction();
        $query = $this->dbHandler->createDeleteQuery();
        $tables = [
            'ezsearch_object_word_link',
            'ezsearch_search_phrase',
            'ezsearch_word',
        ];
        foreach ($tables as $tbl) {
            $query->deleteFrom($tbl);
            $stmt = $query->prepare();
            $stmt->execute();
        }
        $this->dbHandler->commit();
    }
520039
private function trashCollectFiles($data = null)
    {
        $this->debug->groupCollapsed(__METHOD__);
        $data = isset($data)
            ? $data
            : $this->data;
        foreach ($data['pages'] as $info) {
            foreach ($info['values'] as $a) {
                if (\is_array($a) && !empty($a['tmp_name']) && \file_exists($a['tmp_name'])) {
                    $this->debug->log('deleting '.$a['tmp_name']);
                    \unlink($a['tmp_name']);
                }
            }
        }
        $this->debug->groupEnd();
        return;
    }
193589
public function setData(array &$data)
    {
        $this->data = &$data;

        if (!isset($this->data['current'])) {
            $data['current'] = [];
        }

        $this->data['last'] = isset($this->data['current']) ? $this->data['current'] : [];

        $this->data['current'] = [];
    }
204287
public function setLoginData(array $data)
    {
        $data = Helpers::parseLoginData($data);
        $this->getUser()->setLoginData($data[User::ID_LOGIN], $data[User::ID_ROLE], $data[User::ID_UNIT], $data[User::LOGOUT_DATE]);
    }
1003164
public function on_resource_end(array $data) {
        if ($successor = $this->get_successor($data['type'], $data['reference'])) {
            $successor->on_legacy_resource_end($data);
        }
    }
1169390
final public function create(array $data)
    {
        $this->query->setStartInsert($data);
        
        $this->query->prepare()->bindValuesForInsert($data)->execute();

        $this->setRowCount();

        $this->query->close();
    }
57674
public function fill(array $data)
    {
        foreach ($data as $key => $value) {
            if (in_array($key, $this->fillable)) {
                $this->{$key} = $value;
            }
        }
    }
238174
protected function _cleanupData(array $data = array())
    {
        $clean = array();

        foreach ($data as $key => $value)
        {
            if (!empty($value)) {
                $clean[$key] = $value;
            }
        }

        return $clean;
    }
701334
protected function queueSomeForDeletion(array $variants)
    {
        $this->deleteTarget    = $this->makeTargetInstanceWithCurrentData();
        $this->queuedForDelete = array_unique(array_merge($this->queuedForDelete, $variants));
    }