public function getDepotByCode($code) { $this->_validate($code, "code"); try { return \Akzo\Geography\Depot::where('code', 'like', $code)->first(); } catch (\PDOException $e) { $GLOBALS['logger']->info("Error: " . $e->getMessage()); throw new \InvalidArgumentException(\Akzo\Product\ErrorMessages::PROCESS_ERROR, \Native5\Core\Http\StatusCodes::BAD_REQUEST); } }