Changeset 1578 for trunk/src/main/php/net/stubbles/ipo
- Timestamp:
- 05/23/08 12:50:46 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ipo/request/broker/annotations/stubFilterAnnotation.php
r1281 r1578 26 26 27 27 /** 28 * sets whether the value is required or not 29 * 30 * @param bool $isRequired 31 */ 32 public function setRequired($isRequired); 33 34 /** 28 35 * returns the filter defined by the annotation 29 36 * trunk/src/main/php/net/stubbles/ipo/request/broker/stubRequestBroker.php
r1575 r1578 32 32 * 33 33 * @param stubRequest $request 34 * @param object $object the object instance to fill with values 35 * @param string $prefix optional prefix for access to request values 34 * @param object $object the object instance to fill with values 35 * @param string $prefix optional prefix for access to request values 36 * @param bool $required optional make everything on the object optional 36 37 * @throws stubIllegalArgumentException 37 38 */ 38 public function process(stubRequest $request, $object, $prefix = '' )39 public function process(stubRequest $request, $object, $prefix = '', $required = true) 39 40 { 40 41 if ($object instanceof stubObject) { … … 49 50 if ($this->isAvailable($refProperty) === true) { 50 51 $filterAnnotation = $refProperty->getAnnotation('Filter'); 52 if (false === $required) { 53 $filterAnnotation->setRequired(false); 54 } 55 51 56 $value = $request->getFilteredValue($filterAnnotation->getFilter(), $prefix . $filterAnnotation->getFieldName()); 52 57 if ($request->hasValueError($prefix . $filterAnnotation->getFieldName()) === false) { … … 59 64 if ($this->isAvailable($refMethod) === true) { 60 65 $filterAnnotation = $refMethod->getAnnotation('Filter'); 66 if (false === $required) { 67 $filterAnnotation->setRequired(false); 68 } 69 61 70 $value = $request->getFilteredValue($filterAnnotation->getFilter(), $prefix . $filterAnnotation->getFieldName()); 62 71 if ($request->hasValueError($prefix . $filterAnnotation->getFieldName()) === false) {
