private function assertDate(Cashflow $cashflow) { if ($this->getDate()->format('U') >= $cashflow->getFrom()->format('U') && $this->getDate()->format('U') <= $cashflow->getTo()->format('U')) { return true; } throw new \Exception('Impossible to import ' . $this->getName() . ' ' . $this->getDate()->format('Y-m-d')); }