src/libraries/adapters/DatabaseSimpleDb.php
/**
    * Update multiple tags.
    * The $params should include the tag in the `id` field.
    * [{id: tag1, count:10, longitude:12.34, latitude:56.78},...]
    *
    * @param array $params Tags and related attributes to update.
    * @return boolean
    */
Update multiple tags.
The $params should include the tag in the `id` field.

@param array $params Tags and related attributes to update.
@return boolean
Update multiple tags . The $params should include the tag in the ` id ` field . @param array $params Tags and related attributes to update . @return boolean
public function postTags($params)
  {
    $queue = $this->getBatchRequest();
    foreach($params as $tagObj)
    {
      if(!isset($tagObj['id']) || empty($tagObj['id']))
        continue;
      $tag = $tagObj['id'];
      unset($tagObj['id']);
      if(!isset($tagObj['count']))
        $tagObj['count'] = 0;
      else
        $tagObj['count'] = max(0, intval($tagObj['count']));
      $this->db->batch($queue)->put_attributes($this->domainTag, $tag, $tagObj, true);
    }
    $responses = $this->db->batch($queue)->send();
    $this->logErrors($responses);
    return $responses->areOK();
  }
public function postTags ( $ params ) { $ queue = $ this -> getBatchRequest ( ) ; foreach ( $ params as $ tagObj ) { if ( ! isset ( $ tagObj [ 'id' ] ) || empty ( $ tagObj [ 'id' ] ) ) continue ; $ tag = $ tagObj [ 'id' ] ; unset ( $ tagObj [ 'id' ] ) ; if ( ! isset ( $ tagObj [ 'count' ] ) ) $ tagObj [ 'count' ] = 0 ; else $ tagObj [ 'count' ] = max ( 0 , intval ( $ tagObj [ 'count' ] ) ) ; $ this -> db -> batch ( $ queue ) -> put_attributes ( $ this -> domainTag , $ tag , $ tagObj , true ) ; } $ responses = $ this -> db -> batch ( $ queue ) -> send ( ) ; $ this -> logErrors ( $ responses ) ; return $ responses -> areOK ( ) ; }
Update multiple tags.
Update multiple tags .
// TODO use batch_put_attributes instead of a queue // TODO determine if updating tags requires count to be passed. Doesn't feel like it should.