| 
									
										
										
										
											2015-07-05 15:16:44 +02:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace FireflyIII\Helpers\Csv\Converter; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use FireflyIII\Models\TransactionCurrency; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Class CurrencySymbol | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package FireflyIII\Helpers\Csv\Converter | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class CurrencySymbol extends BasicConverter implements ConverterInterface | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @return mixed|static | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function convert() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         if (isset($this->mapped[$this->index][$this->value])) { | 
					
						
							|  |  |  |             $currency = TransactionCurrency::find($this->mapped[$this->index][$this->value]); | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $currency = TransactionCurrency::whereSymbol($this->value)->first(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return $currency; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-09 21:26:40 +02:00
										 |  |  | } |