- Fixed 'value' for SearchRequestOrderBy and also fixed a typo where SearchManual would not be set
This commit is contained in:
		
							parent
							
								
									4106c8db91
								
							
						
					
					
						commit
						3ba8a2a5d0
					
				| @ -12,12 +12,20 @@ class Datetime extends \DateTime implements EntityObjectInterface { | ||||
|     { | ||||
|         $value = $arguments[0]; | ||||
| 
 | ||||
|         # From Timestamp
 | ||||
|         if ( is_numeric($value) ) { | ||||
|             return new static("@$value"); | ||||
|         try { | ||||
|             # From Timestamp
 | ||||
|             if ( is_numeric($value) ) { | ||||
|                 $obj = new static("@$value"); | ||||
|             } | ||||
|             else { | ||||
|                 $obj = new static($value); | ||||
|             } | ||||
|         } | ||||
|         catch(\Throwable $ex) { | ||||
|             throw new \Exception(sprintf("An error occured trying to instanciate from '%s'. %s", $value, $ex->getMessage()), $ex->getCode(), $ex); | ||||
|         } | ||||
| 
 | ||||
|         return new static($value); | ||||
|         return $obj; | ||||
|     } | ||||
| 
 | ||||
|     public function save() | ||||
|  | ||||
| @ -60,6 +60,8 @@ trait SearchRequestFromRequestTrait | ||||
|                     $field = $fieldName; | ||||
|                 } | ||||
| 
 | ||||
|                 $value = $this->getValueFromSource($request, $propertyName, $attribute); | ||||
| 
 | ||||
|                 switch(true) { | ||||
|                     case $attribute instanceof SearchGroupBy: | ||||
|                         $this->parseAttributeGroupBy($attribute, $field, $propertyName); | ||||
| @ -67,14 +69,13 @@ trait SearchRequestFromRequestTrait | ||||
| 
 | ||||
|                     case $attribute instanceof SearchWhere: | ||||
|                     case $attribute instanceof SearchLike: | ||||
|                     case $attribute instanceof SearchManuel: | ||||
| 
 | ||||
|                         $value = $this->getValueFromSource($request, $propertyName, $attribute); | ||||
| 
 | ||||
|                     case $attribute instanceof SearchManual: | ||||
|                         if ($value !== null) { | ||||
|                             $value = $this->transformValue($property->getAttributes(Attribute\PropertyValueModifier::class), $value); | ||||
|                         } | ||||
| 
 | ||||
|                         dump($value); | ||||
| 
 | ||||
|                         if ($attribute->toggle) { | ||||
|                             $this->$propertyName = !empty($value); | ||||
|                         } elseif ($value !== null) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user