public function loadUser($username) { // $this->_validate($username, "code"); try { return \Akzo\User::where('username', 'like', $username)->get()->first(); } catch (\PDOException $e) { $GLOBALS['logger']->info("Error: " . $e->getMessage()); throw new \InvalidArgumentException(\Akzo\Product\ErrorMessages::PROCESS_ERROR, \Native5\Core\Http\StatusCodes::BAD_REQUEST); } }
private function _loadCardsCommon($uid, $page, $name, $state) { return \Akzo\User::where('code', 'like', $uid)->first()->cards()->where('page', 'like', $page, 'and')->where('name', 'like', $name, 'and')->where('state', 'like', $state)->get(); }
public function getAllToBePayoutApprovedSchemes(\Akzo\User $user, $schemeState = \Akzo\Scheme\State::STAGED) { try { return $user->toBePayoutApprovedSchemes()->with(array('initiator', 'reviewer', 'approver'))->where('state', 'not like', \Akzo\Scheme\State::STAGED)->orderBy('created_at', 'DESC')->get(); } catch (\PDOException $e) { $GLOBALS['logger']->info("Error: " . $e->getMessage()); throw new \InvalidArgumentException(\Akzo\Product\ErrorMessages::PROCESS_ERROR, \Native5\Core\Http\StatusCodes::BAD_REQUEST); } }