예제 #1
0
파일: Csv.php 프로젝트: alab1001101/zf2
 /**
  * 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);
 }
예제 #2
0
파일: Csv.php 프로젝트: bradley-holt/zf2
 /**
  * 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);
 }
예제 #3
0
 /**
  * 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;
 }
예제 #4
0
파일: Form.php 프로젝트: rikaix/zf2
 /**
  * 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');
     }
 }
예제 #5
0
 /**
  * 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);
 }