public function setDecorator($val, Entity $entity, $name, $silentException=false) {
		if($this->get('many')) {
			if($val instanceof ManyCollection)
				return $val;
			if(is_array($val)) {
				$res = new ManyCollection($entity, $name);
				foreach($val as $v)
					$res[] = $this->_doSet($v, $entity, $name, $silentException);
				return $res;
			}
			else
				return $val;
		}
		else
			return $this->_doSet($val, $entity, $name, $silentException);
	}
public function setDecorator($val, Entity $entity, $name, $silentException=false) {
		if($this->get('many')) {
			if($val instanceof ManyCollection)
				return $val;
			if(is_array($val)) {
				$res = new ManyCollection($entity, $name);
				foreach($val as $v)
					$res[] = $this->_doSet($v, $entity, $name, $silentException);
				return $res;
			}
			else
				return $val;
		}
		else
			return $this->_doSet($val, $entity, $name, $silentException);
	}
public function setDecorator ( $ val , Entity $ entity , $ name , $ silentException = false ) { if ( $ this -> get ( 'many' ) ) { if ( $ val instanceof ManyCollection ) return $ val ; if ( is_array ( $ val ) ) { $ res = new ManyCollection ( $ entity , $ name ) ; foreach ( $ val as $ v ) $ res [ ] = $ this -> _doSet ( $ v , $ entity , $ name , $ silentException ) ; return $ res ; } else return $ val ; } else return $ this -> _doSet ( $ val , $ entity , $ name , $ silentException ) ; }
Pre-process value before passing it to entity.
@param mixed  $val
@param Entity $entity
@param string $name
@param boolean  $silentException
@return mixed
Pre - process value before passing it to entity .