original_string: public function sync($mailbox, $token, array $opts = array())
      {
          if (($token = base64_decode($token, true)) === false) {
              throw new Horde_Imap_Client_Exception_Sync('Bad token.', Horde_Imap_Client_Exception_Sync::BAD_TOKEN);
          }
  
          $sync = array();
          foreach (explode(',', $token) as $val) {
              $sync[substr($val, 0, 1)] = substr($val, 1);
          }
  
          return new Horde_Imap_Client_Data_Sync(
              $this,
              $mailbox,
              $sync,
              $this->_syncStatus($mailbox),
              (isset($opts['criteria']) ? $opts['criteria'] : Horde_Imap_Client::SYNC_ALL),
              (isset($opts['ids']) ? $opts['ids'] : null)
          );
      }
code: public function sync($mailbox, $token, array $opts = array())
      {
          if (($token = base64_decode($token, true)) === false) {
              throw new Horde_Imap_Client_Exception_Sync('Bad token.', Horde_Imap_Client_Exception_Sync::BAD_TOKEN);
          }
  
          $sync = array();
          foreach (explode(',', $token) as $val) {
              $sync[substr($val, 0, 1)] = substr($val, 1);
          }
  
          return new Horde_Imap_Client_Data_Sync(
              $this,
              $mailbox,
              $sync,
              $this->_syncStatus($mailbox),
              (isset($opts['criteria']) ? $opts['criteria'] : Horde_Imap_Client::SYNC_ALL),
              (isset($opts['ids']) ? $opts['ids'] : null)
          );
      }
code_tokens: public function sync ( $ mailbox , $ token , array $ opts = array ( ) ) { if ( ( $ token = base64_decode ( $ token , true ) ) === false ) { throw new Horde_Imap_Client_Exception_Sync ( 'Bad token.' , Horde_Imap_Client_Exception_Sync :: BAD_TOKEN ) ; } $ sync = array ( ) ; foreach ( explode ( ',' , $ token ) as $ val ) { $ sync [ substr ( $ val , 0 , 1 ) ] = substr ( $ val , 1 ) ; } return new Horde_Imap_Client_Data_Sync ( $ this , $ mailbox , $ sync , $ this -> _syncStatus ( $ mailbox ) , ( isset ( $ opts [ 'criteria' ] ) ? $ opts [ 'criteria' ] : Horde_Imap_Client :: SYNC_ALL ) , ( isset ( $ opts [ 'ids' ] ) ? $ opts [ 'ids' ] : null ) ) ; }
docstring: Synchronize a mailbox from a sync token.
  
  @since 2.2.0
  
  @param mixed $mailbox  A mailbox. Either a Horde_Imap_Client_Mailbox
  object or a string (UTF-8).
  @param string $token   A sync token generated by getSyncToken().
  @param array $opts     Additional options:
  - criteria: (integer) Mask of Horde_Imap_Client::SYNC_* criteria to
  return. Defaults to SYNC_ALL.
  - ids: (Horde_Imap_Client_Ids) A cached list of UIDs. Unless QRESYNC
  is available on the server, failure to specify this option
  means SYNC_VANISHEDUIDS information cannot be returned.
  
  @return Horde_Imap_Client_Data_Sync  A sync object.
  
  @throws Horde_Imap_Client_Exception
  @throws Horde_Imap_Client_Exception_Sync
docstring_tokens: Synchronize a mailbox from a sync token .