/** * This method overrides the parent implementation. * * @param mixed $key * @param mixed $value */ public function add($key, $value) { foreach (self::getAvailableProperties() as $k => $v) { if (strtolower($key) == strtolower($k)) { return parent::add($key, $value); } } throw new TNotSupportedException('Property not supported.'); }
/** * Returns the list of custom parameters. * Custom parameters are name-value pairs that may subsititute translation * place holders during rendering. * @return TAttributeCollection the list of custom parameters */ public function getParameters() { if ($parameters = $this->getViewState('Parameters', null)) { return $parameters; } else { $parameters = new TAttributeCollection(); $parameters->setCaseSensitive(true); $this->setViewState('Parameters', $parameters, null); return $parameters; } }
public function testHasProperty() { $collection = new TAttributeCollection(); self::assertEquals(false, $collection->hasProperty('Property')); $collection->Property = 'value'; self::assertEquals(true, $collection->hasProperty('Property')); }