Const'r
public __construct ( array $params = [] ) : Horde_ActiveSync_Driver | ||
$params | array | Any configuration parameters or injected objects the concrete driver may need. - logger: (Horde_Log_Logger) The logger. DEFAULT: none (No logging). - state: (Horde_ActiveSync_State_Base) The state driver. DEFAULT: none (REQUIRED). |
Результат | Horde_ActiveSync_Driver |
public function __construct($params = array()) { parent::__construct($params); $this->_connector = $params['connector']; //$this->_auth = $params['auth']; $this->_imap = $params['imap']; }
/** * Const'r * * @param array $params Configuration parameters: * - logger: (Horde_Log_Logger) The logger. * DEFAULT: none (No logging). * * - state: (Horde_ActiveSync_State_Base) The state driver. * DEFAULT: none (REQUIRED). * - connector: (Horde_Core_ActiveSync_Connector) The connector object * for communicating with the registry. * DEFAULT: none (REQUIRED) * - auth: (Horde_Auth) The auth object. * DEFAULT: none (REQUIRED). * - imap: (Horde_ActiveSync_Imap_Adapter) The IMAP adapter if email * support is desired. * DEFAULT: none (No email support will be provided). * - cache: (Horde_Cache) A cache object to store certain types of * data, such as mailbox search results. * @since 2.12.0 */ public function __construct(array $params = array()) { parent::__construct($params); $this->_pid = getmypid(); if (empty($this->_params['connector']) || !$this->_params['connector'] instanceof Horde_Core_ActiveSync_Connector) { throw new InvalidArgumentException('Missing required connector object.'); } if (empty($this->_params['auth']) || !$this->_params['auth'] instanceof Horde_Auth_Base) { throw new InvalidArgumentException('Missing required Auth object'); } $this->_connector = $params['connector']; $this->_auth = $params['auth']; unset($this->_params['connector']); unset($this->_params['auth']); if (!empty($this->_params['imap'])) { $this->_imap = $this->_params['imap']; unset($this->_params['imap']); } if (!empty($this->_params['cache'])) { $this->_cache = $this->_params['cache']; } // Build the displaymap $this->_displayMap = array(self::APPOINTMENTS_FOLDER_UID => Horde_ActiveSync_Translation::t('Calendar'), self::CONTACTS_FOLDER_UID => Horde_ActiveSync_Translation::t('Contacts'), self::TASKS_FOLDER_UID => Horde_ActiveSync_Translation::t('Tasks'), self::NOTES_FOLDER_UID => Horde_ActiveSync_Translation::t('Notes')); }