Apache Zeta Components Manual :: File Source for ts_backend.php

Source for file ts_backend.php

Documentation is available at ts_backend.php

  1. <?php
  2. /**
  3.  * File containing the ezcTranslationTsBackendOptions class.
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @package Translation
  23.  * @version //autogentag//
  24.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  25.  * @filesource
  26.  */
  27.  
  28. /**
  29.  * Struct class to store the options of the ezcTranslationTsBackend class.
  30.  *
  31.  * This class stores the options for the {@link ezcTranslationTsBackend} class.
  32.  *
  33.  * @property string $location 
  34.  *            Path to the directory that contains all TS .xml files.
  35.  * @property string $format 
  36.  *            Format for the translation file's name.  In this format
  37.  *            string the special place holder [LOCALE] will be
  38.  *            replaced with the requested locale's name. For example a
  39.  *            format of "translations/[LOCALE].xml" will result in the
  40.  *            filename for the translation file to be
  41.  *            "translations/nl_NL.xml" if the nl_NL locale is
  42.  *            requested.
  43.  * @property bool $keepObsolete 
  44.  *            When this option is set to "true" the reader will not drop
  45.  *            translation messages with the "obsolete" type set.
  46.  * 
  47.  * @package Translation
  48.  * @version //autogentag//
  49.  * @mainclass
  50.  */
  51. {
  52.     /**
  53.      * Constructs a new options class.
  54.      *
  55.      * It also sets the default values of the format property
  56.      *
  57.      * @param array(string=>mixed) $array The initial options to set.
  58.      *
  59.      * @throws ezcBasePropertyNotFoundException
  60.      *          If a the value for the property options is not an instance of
  61.      * @throws ezcBaseValueException
  62.      *          If a the value for a property is out of range.
  63.      */
  64.     public function __construct$array array() )
  65.     {
  66.         $this->properties['format''[LOCALE].xml';
  67.         $this->properties['keepObsolete'false;
  68.         parent::__construct$array );
  69.     }
  70.  
  71.     /**
  72.      * Property write access.
  73.      * 
  74.      * @throws ezcBasePropertyNotFoundException
  75.      *          If a desired property could not be found.
  76.      * @throws ezcBaseSettingValueException
  77.      *          If a desired property value is out of range.
  78.      *
  79.      * @param string $propertyName Name of the property.
  80.      * @param mixed $val  The value for the property.
  81.      * @ignore
  82.      */
  83.     public function __set$propertyName$val )
  84.     {
  85.         switch $propertyName )
  86.         {
  87.             case 'location':
  88.                 if $val[strlen$val 1!= '/' )
  89.                 {
  90.                     $val .= '/';
  91.                 }
  92.                 break;
  93.             case 'format':
  94.             case 'keepObsolete':
  95.                 break;
  96.             default:
  97.                 throw new ezcBaseSettingNotFoundException$propertyName );
  98.         }
  99.         $this->properties[$propertyName$val;
  100.     }
  101. }
  102.  
  103. ?>
Documentation generated by phpDocumentor 1.4.3