/** * Generates the adapter * * @param array|Zend_Config $options Translation content */ public function __construct($options = array()) { $this->_options['delimiter'] = ";"; $this->_options['length'] = 0; $this->_options['enclosure'] = '"'; if ($options instanceof Zend_Config) { $options = $options->toArray(); } else { if (func_num_args() > 1) { $args = func_get_args(); $options = array(); $options['content'] = array_shift($args); if (!empty($args)) { $options['locale'] = array_shift($args); } if (!empty($args)) { $opt = array_shift($args); $options = array_merge($opt, $options); } } else { if (!is_array($options)) { $options = array('content' => $options); } } } parent::__construct($options); }
/** * Generates the adapter * * @param string $data OPTIONAL Translation data * @param string|\Zend\Locale\Locale $locale OPTIONAL Locale/Language to set, identical with locale identifier, * see Zend_Locale for more information * @param array $options OPTIONAL Options for this adapter */ public function __construct($data = null, $locale = null, array $options = array()) { $this->_options['delimiter'] = ";"; $this->_options['length'] = 0; $this->_options['enclosure'] = '"'; parent::__construct($data, $locale, $options); }
/** * Set translator object * * @param Translator\Translator|Translator\Adapter|null $translator * @return DisplayGroup */ public function setTranslator($translator = null) { if (null === $translator || $translator instanceof Translator\Adapter\AbstractAdapter) { $this->_translator = $translator; } elseif ($translator instanceof Translator\Translator) { $this->_translator = $translator->getAdapter(); } else { throw new Exception\InvalidArgumentException('Invalid translator specified'); } return $this; }
/** * Set global default translator object * * @param Translator\Translator|Translator\Adapter|null $translator * @return void */ public static function setDefaultTranslator($translator = null) { if (null === $translator) { self::$_translatorDefault = null; } elseif ($translator instanceof Translator\Adapter\AbstractAdapter) { self::$_translatorDefault = $translator; } elseif ($translator instanceof Translator\Translator) { self::$_translatorDefault = $translator->getAdapter(); } else { throw new Exception\InvalidArgumentException('Invalid translator specified'); } }
/** * Clears all set cache data * * @param string $tag Tag to clear when the default tag name is not used * @return void */ public static function clearCache($tag = null) { Adapter::clearCache($tag); }