Changeset 1882
- Timestamp:
- 10/07/08 14:38:56 (1 month ago)
- Files:
-
- framework/trunk/src/main/php/net/stubbles/ipo/request/broker/annotations/stubDateFilterAnnotation.php (modified) (6 diffs)
- framework/trunk/src/main/php/net/stubbles/ipo/request/filter/stubPeriodFilterDecorator.php (modified) (3 diffs)
- framework/trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisPatTemplate.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework/trunk/src/main/php/net/stubbles/ipo/request/broker/annotations/stubDateFilterAnnotation.php
r1867 r1882 88 88 $minDate = new stubDate($minDate); 89 89 } 90 90 91 91 $this->minDate = $minDate; 92 92 } … … 132 132 $maxDate = new stubDate($maxDate); 133 133 } 134 134 135 135 $this->maxDate = $maxDate; 136 136 } … … 159 159 * sets the error id to use in case max date validation fails 160 160 * 161 * @param string $max ErrorId161 * @param string $maxDateErrorId 162 162 */ 163 163 public function setMaxDateErrorId($maxDateErrorId) … … 190 190 $this->setMaxDate($this->getDateFromProvider($this->maxDateProviderClass, $this->maxDateProviderMethod)); 191 191 } 192 192 193 193 if (null !== $this->minDate || null !== $this->maxDate) { 194 194 $filter = new stubPeriodFilterDecorator($filter, $this->createRVEFactory()); … … 196 196 $filter->setMinDate($this->minDate, $this->minDateErrorId); 197 197 } 198 198 199 199 if (null !== $this->maxDate) { 200 200 $filter->setMaxDate($this->maxDate, $this->maxDateErrorId); 201 201 } 202 202 203 203 if (null != $this->dateFormat) { 204 204 $filter->setDateFormat($this->dateFormat); 205 205 } 206 206 } 207 207 208 208 return $filter; 209 209 } … … 222 222 return $method->invoke(null); 223 223 } 224 224 225 225 return $method->invoke($providerClass->newInstance()); 226 226 } framework/trunk/src/main/php/net/stubbles/ipo/request/filter/stubPeriodFilterDecorator.php
r1863 r1882 107 107 * 108 108 * @param stubDate $maxDate 109 * @param string $max LengthErrorId optional error id to use in case validation fails109 * @param string $maxDateErrorId optional error id to use in case validation fails 110 110 */ 111 111 public function setMaxDate(stubDate $maxDate, $maxDateErrorId = null) … … 169 169 return null; 170 170 } 171 171 172 172 if (null != $this->minDate && $this->minDate->isAfter($value) === true) { 173 173 throw new stubFilterException($this->rveFactory->create($this->minDateErrorId)->setValues(array('earliestDate' => $this->minDate->format($this->dateFormat)))); … … 175 175 throw new stubFilterException($this->rveFactory->create($this->maxDateErrorId)->setValues(array('latestDate' => $this->maxDate->format($this->dateFormat)))); 176 176 } 177 177 178 178 return $value; 179 179 } framework/trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisPatTemplate.php
r1879 r1882 38 38 * constructor 39 39 * 40 * @param string $baseDir directory where template files can be found 41 * @param array $namespaces optional namespaces for patTemplate tags, default patTemplate 42 * @param array $options optional configuration options for patTemplate 40 * @param string $baseDir directory where template files can be found 41 * @param array $namespaces optional namespaces for patTemplate tags, default patTemplate 42 * @param array $options optional configuration options for patTemplate 43 * @throws stubConfigurationException 43 44 */ 44 45 public function __construct($baseDir, array $namespaces = array(), array $options = array()) … … 50 51 throw new stubConfigurationException('The registry entry net.php-tools.path is not configured.'); 51 52 } 52 53 53 54 stubClassLoader::load('net::stubbles::util::ext::stubPhpToolsClassLoader'); 54 55 $patClassLoader = new stubPhpToolsClassLoader(stubRegistry::getConfig('net.php-tools.path')); … … 58 59 self::$initialized = true; 59 60 } 60 61 61 62 if (count($namespaces) === 0) { 62 63 $namespaces = array('patTemplate'); 63 64 } 64 65 65 66 if (isset($options['componentExtension']) === false) { 66 67 $options['componentExtension'] = '.tmpl'; 67 68 } 68 69 69 70 $this->template = new patTemplate(); 70 71 $this->template->setBasedir($baseDir); … … 81 82 * stubConfig::getCachePath() . '/patTemplate'. The default prefix will be 82 83 * 'tmpl_', the default patTemplate cache driver used will be the File driver. 83 * 84 * 84 85 * @param string $cacheDir optional directory to put cache files into 85 86 * @param string $prefix optional prefix for cache files … … 91 92 $cacheDir = stubConfig::getCachePath() . '/patTemplate'; 92 93 } 93 94 94 95 $this->template->useTemplateCache($type, array('cacheFolder' => $cacheDir, 95 96 'prefix' => $prefix … … 114 115 throw new stubException($return->getMessage()); 115 116 } 116 117 117 118 return $return; 118 119 } … … 197 198 throw new stubException($return->getMessage()); 198 199 } 199 200 200 201 return $return; 201 202 } … … 217 218 throw new stubException($return->getMessage()); 218 219 } 219 220 220 221 return $return; 221 222 } 222 223 223 224 $backtrace = debug_backtrace(); 224 225 throw new stubIllegalAccessException('Method patTemplate::' . $method . ' called in ' . $backtrace[2]['class'] . '::' . $backtrace[2]['function'] . '() on line ' . $backtrace[2]['line'] . ' does not exist.');
